Skip to content

Commit

Permalink
Merge pull request #1084 from openkraken/fix/intrinsic-cliprect
Browse files Browse the repository at this point in the history
fix: RenderIntrinsic should only clip when border-radius exist
  • Loading branch information
wssgcg1213 authored Jan 12, 2022
2 parents 0c84550 + 8150bb2 commit 1545d0a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions kraken/lib/src/rendering/intrinsic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ class RenderIntrinsic extends RenderBoxModel
return heightDefined ? BoxSizeType.specified : BoxSizeType.intrinsic;
}

// Set clipX and clipY to true for background cannot overflow beyond the boundary of replaced element
// The content of replaced elements is always trimmed to the content edge curve.
// https://www.w3.org/TR/css-backgrounds-3/#corner-clipping
@override
bool get clipX => true;
bool get clipX {
// Only clip when content of replaced element is loaded.
return renderStyle.borderRadius != null && renderStyle.intrinsicRatio != null;
}

@override
bool get clipY => true;
bool get clipY {
return renderStyle.borderRadius != null && renderStyle.intrinsicRatio != null;
}

@override
void setupParentData(RenderBox child) {
Expand Down

0 comments on commit 1545d0a

Please sign in to comment.