Any way to avoid clipping the shadow of a FAB duri...
# compose
z
Any way to avoid clipping the shadow of a FAB during animations?
e
Turn off clipping on itself & all ancestors in the area in which you want it to animate
z
Just using graphics layer clip?
GraphicsLayer.clip is false by default, so I think Ill need something else?
Copy code
Set to true to clip the content to the shape. Default value is false
The backing surface of FAB calls clip(shape) after shadow + background. I dont think thats whats causing the issue here though, the shadow works just fine w/o any animation.
e
Unfortnately many things call clip w/o your knowlege (scrollable modifier for instance). You’ll need to go through the hierarchy to see what exactly is clipping it. If clipping is only happening in animation then maybe its the animation/transition itself that’s clipping it 🤔
z
Do you know how to stop the animations from clipping the content? I use clip=false in enter/exit transitions, and they generally can go outside of their bounds because of this, but the shadows seem to receive some special treatment. Maybe they're drawn in a separate layer from the content?
e
No, I dont remember it off hand
z
Ok 🫡 I'll check the source of animated content, maybe I can dig something up. The same thing happens to cards and their shadows, even if the content being animated is the whole screen.
v
`AnimatedContent`'s default transition spec does not define
... using SizeTransform()
, which defaults to
SizeTransform(clip = true)
, maybe try overriding it and setting it to
clip = false
?
z
Tried that too, no difference!
😢 2