Closed undermark5 closed 6 months ago
Maybe the parameter isn't actually doing what I think it is, turns out our issue was solved by adding a clipToBounds
modifier to the Lottie itself, but I feel as though that shouldn't have to be added as a modifier and there should be a way to clip the Lottie to layout bounds directly.
Is your feature request related to a problem? Please describe. While trying to figure out why it seemed as though our use of the LottieAnimation composable was misbehaving, I realized that the
clipToCompositionBounds
parameter does not refer toJetpack Compose
's composition, but the Lottie animation composition. While the fact that the parameter to specify the animation iscomposition
, the docs don't make the use of referencing that parameter (which would help clarify it's notJetpack Compose
's composition), theclip
portion of the name is also misleading because in some circumstances this means that the Lottie will be rendered outside of the containers bounds, which means that in such circumstances, the parameter beingtrue
means the lottie will be larger than when the value is set tofalse
Describe the solution you'd like I propose that the parameter documentation is improved (so that the
composition
text refers to thecomposition
parameter) and thatclip
be swapped forexpand
(or the behavior inverted, such that whenclip
is true, the results will be smaller than withfalse
, though I feel as thoughexpand
is the better approach here)Describe alternatives you've considered I can obviously write my own wrapper functions, but I'm sure I won't be the first to be confused by the fact that
clip == true
can mean the Lottie draws outside of the container bounds.