From 069cddaa6711044f1664dc483769b1ccb635d04d Mon Sep 17 00:00:00 2001 From: liyuqian Date: Thu, 13 Sep 2018 11:42:49 -0700 Subject: [PATCH] Missing default hardEdge clip for ClipRectLayer (#21826) In my local tests, this should finally fix https://github.com/flutter/flutter/issues/21617 --- bin/internal/goldens.version | 2 +- packages/flutter/lib/src/rendering/layer.dart | 2 +- packages/flutter/lib/src/rendering/object.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/internal/goldens.version b/bin/internal/goldens.version index 502ab1e0fac..471b9a16cc7 100644 --- a/bin/internal/goldens.version +++ b/bin/internal/goldens.version @@ -1 +1 @@ -da68caa0a261663858998e047c02560e94404e7a +96ed11be7a52f9b8ace5af0a286d8d4415dbd78b diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index 67ab28afd81..92cfdb70356 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -622,7 +622,7 @@ class ClipRectLayer extends ContainerLayer { /// /// The [clipRect] property must be non-null before the compositing phase of /// the pipeline. - ClipRectLayer({ this.clipRect, Clip clipBehavior = Clip.antiAlias }) : + ClipRectLayer({ this.clipRect, Clip clipBehavior = Clip.hardEdge }) : _clipBehavior = clipBehavior, assert(clipBehavior != null), assert(clipBehavior != Clip.none); /// The rectangle to clip in the parent's coordinate system. diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index fa89f96bcda..744004b016f 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -385,7 +385,7 @@ class PaintingContext extends ClipContext { /// * `painter` is a callback that will paint with the [clipRect] applied. This /// function calls the [painter] synchronously. /// * `clipBehavior` controls how the rectangle is clipped. - void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias}) { + void pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.hardEdge}) { final Rect offsetClipRect = clipRect.shift(offset); if (needsCompositing) { pushLayer(ClipRectLayer(clipRect: offsetClipRect, clipBehavior: clipBehavior), painter, offset, childPaintBounds: offsetClipRect);