Missing default hardEdge clip for ClipRectLayer (#21826)

In my local tests, this should finally fix https://github.com/flutter/flutter/issues/21617
This commit is contained in:
liyuqian 2018-09-13 11:42:49 -07:00 committed by GitHub
parent 9bf8502fef
commit 069cddaa67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -1 +1 @@
da68caa0a261663858998e047c02560e94404e7a
96ed11be7a52f9b8ace5af0a286d8d4415dbd78b

View file

@ -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.

View file

@ -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);