Skip to content

Commit ed37888

Browse files
afohrmangsajith
authored andcommitted
Remove MaterialShapeDrawable hairline inset from fill bounds.
PiperOrigin-RevId: 219303758
1 parent d9d9b6e commit ed37888

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -772,18 +772,7 @@ protected void drawShape(Canvas canvas, Paint paint, Path path, RectF bounds) {
772772
}
773773

774774
private void drawFillShape(Canvas canvas) {
775-
drawShape(canvas, fillPaint, path, getFillBounds());
776-
}
777-
778-
protected RectF getFillBounds() {
779-
RectF fillBounds = getBoundsAsRectF();
780-
// If there's a stroke, inset the bounds by a hairline to prevent the fill from peeking out from
781-
// under the stroke.
782-
if (hasStroke()) {
783-
float hairline = 1f;
784-
fillBounds.inset(hairline, hairline);
785-
}
786-
return fillBounds;
775+
drawShape(canvas, fillPaint, path, getBoundsAsRectF());
787776
}
788777

789778
private void drawStrokeShape(Canvas canvas) {

0 commit comments

Comments
 (0)