Skip to content

Commit 9a8272d

Browse files
committed
[Shape] Updated isRoundRectCornerMorph and pathDirty logic in MaterialShapeDrawable
PiperOrigin-RevId: 829468349
1 parent 07a3be5 commit 9a8272d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/java/com/google/android/material/shape/MaterialShapeDrawable.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,12 @@ private void updateShape(int[] state, boolean skipAnimation) {
15631563
}
15641564
ShapeAppearanceModel shapeAppearanceModel =
15651565
drawableState.shapeAppearance.getShapeForState(state);
1566-
if (areAllElementsEqual(springAnimatedCornerSizes)) {
1567-
isRoundRectCornerMorph = shapeAppearanceModel.isRoundRect(getBoundsAsRectF());
1566+
isRoundRectCornerMorph =
1567+
areAllElementsEqual(springAnimatedCornerSizes)
1568+
&& shapeAppearanceModel.isRoundRect(getBoundsAsRectF());
1569+
if (!isRoundRectCornerMorph) {
1570+
pathDirty = true;
1571+
strokePathDirty = true;
15681572
}
15691573
for (int i = 0; i < NUM_CORNERS; i++) {
15701574
float targetCornerSize =

0 commit comments

Comments
 (0)