Fix shape can't be updated
This commit is contained in:
1 parent
ce8bfab7ae
commit
bf3321b896
2 files changed
+7
-2
No files matched your search
@@ -17,6 +17,7 @@ internal interface BackdropShapeProvider {
|
||||
@Immutable
|
||||
internal class CachedBackdropShapeProvider(val shapeProvider: () -> Shape) : BackdropShapeProvider {
|
||||
|
||||
private var _shape: Shape? = null
|
||||
private var _outline: Outline? = null
|
||||
private var _size: Size = Size.Unspecified
|
||||
private var _layoutDirection: LayoutDirection? = null
|
||||
@@ -32,11 +33,16 @@ internal class CachedBackdropShapeProvider(val shapeProvider: () -> Shape) : Bac
|
||||
layoutDirection: LayoutDirection,
|
||||
density: Density
|
||||
): Outline {
|
||||
val shape = shapeProvider()
|
||||
if (_shape != shape) {
|
||||
_shape = shape
|
||||
_outline = null
|
||||
}
|
||||
if (_outline == null || _size != size || _layoutDirection != layoutDirection || _density != density.density) {
|
||||
_size = size
|
||||
_layoutDirection = layoutDirection
|
||||
_density = density.density
|
||||
_outline = innerShape.createOutline(size, layoutDirection, density)
|
||||
_outline = shape.createOutline(size, layoutDirection, density)
|
||||
}
|
||||
|
||||
return _outline!!
|
||||
|
||||
@@ -106,7 +106,6 @@ internal class HighlightNode(
|
||||
if (blurRadius > 0f) {
|
||||
paint.maskFilter = BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.NORMAL)
|
||||
}
|
||||
//paint.asComposePaint().blendMode = highlight.blendMode
|
||||
|
||||
graphicsLayer.blendMode = highlight.blendMode
|
||||
graphicsLayer.record {
|
||||
|
||||
Reference in new issue
Block a user