Unverified Commit 069cddaa authored by liyuqian's avatar liyuqian Committed by GitHub

Missing default hardEdge clip for ClipRectLayer (#21826)

In my local tests, this should finally fix https://github.com/flutter/flutter/issues/21617
parent 9bf8502f
da68caa0a261663858998e047c02560e94404e7a 96ed11be7a52f9b8ace5af0a286d8d4415dbd78b
...@@ -622,7 +622,7 @@ class ClipRectLayer extends ContainerLayer { ...@@ -622,7 +622,7 @@ class ClipRectLayer extends ContainerLayer {
/// ///
/// The [clipRect] property must be non-null before the compositing phase of /// The [clipRect] property must be non-null before the compositing phase of
/// the pipeline. /// 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); _clipBehavior = clipBehavior, assert(clipBehavior != null), assert(clipBehavior != Clip.none);
/// The rectangle to clip in the parent's coordinate system. /// The rectangle to clip in the parent's coordinate system.
......
...@@ -385,7 +385,7 @@ class PaintingContext extends ClipContext { ...@@ -385,7 +385,7 @@ class PaintingContext extends ClipContext {
/// * `painter` is a callback that will paint with the [clipRect] applied. This /// * `painter` is a callback that will paint with the [clipRect] applied. This
/// function calls the [painter] synchronously. /// function calls the [painter] synchronously.
/// * `clipBehavior` controls how the rectangle is clipped. /// * `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); final Rect offsetClipRect = clipRect.shift(offset);
if (needsCompositing) { if (needsCompositing) {
pushLayer(ClipRectLayer(clipRect: offsetClipRect, clipBehavior: clipBehavior), painter, offset, childPaintBounds: offsetClipRect); pushLayer(ClipRectLayer(clipRect: offsetClipRect, clipBehavior: clipBehavior), painter, offset, childPaintBounds: offsetClipRect);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment