Skip to content

Commit

Permalink
fix: overflow hidden container not clip child with its own layer
Browse files Browse the repository at this point in the history
  • Loading branch information
temper357 committed Nov 3, 2021
1 parent e508e8a commit a26c1c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kraken/lib/src/gesture/scrollable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ mixin RenderOverflowMixin on RenderBox {
PaintingContextCallback painter = (PaintingContext context, Offset offset) {
callback(context, offset + paintOffset);
};

// It needs to create new layer to clip children in case children has its own layer
// for all overflow value which is not visible (auto/scroll/hidden/clip).
bool _needsCompositing = true;

if (decoration != null && decoration.borderRadius != null) {
BorderRadius radius = decoration.borderRadius as BorderRadius;
RRect clipRRect = RRect.fromRectAndCorners(clipRect,
Expand All @@ -389,9 +394,9 @@ mixin RenderOverflowMixin on RenderBox {
bottomLeft: radius.bottomLeft,
bottomRight: radius.bottomRight
);
_oldClipRRectLayer = context.pushClipRRect(needsCompositing, offset, clipRect, clipRRect, painter, oldLayer: _oldClipRRectLayer);
_oldClipRRectLayer = context.pushClipRRect(_needsCompositing, offset, clipRect, clipRRect, painter, oldLayer: _oldClipRRectLayer);
} else {
_oldClipRectLayer = context.pushClipRect(needsCompositing, offset, clipRect, painter, oldLayer: _oldClipRectLayer);
_oldClipRectLayer = context.pushClipRect(_needsCompositing, offset, clipRect, painter, oldLayer: _oldClipRectLayer);
}
} else {
_oldClipRRectLayer = null;
Expand Down

0 comments on commit a26c1c8

Please sign in to comment.