Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 634135f

Browse files
committed
Round SkRects in ClipRectContainsPlatformViewBoundingRect
1 parent a718337 commit 634135f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ static bool ClipRectContainsPlatformViewBoundingRect(const SkRect& clip_rect,
4545
const SkRect& platformview_boundingrect,
4646
const SkMatrix& transform_matrix) {
4747
SkRect transformed_rect = transform_matrix.mapRect(clip_rect);
48-
return transformed_rect.contains(platformview_boundingrect);
48+
49+
// Float imprecision has accumulated, round to integers to check boundaries.
50+
SkIRect transformed_rect_rounded = transformed_rect.round();
51+
SkIRect platformview_boundingrect_rounded = platformview_boundingrect.round();
52+
53+
return transformed_rect_rounded.contains(platformview_boundingrect_rounded);
4954
}
5055

5156
// Determines if the `clipRRect` from a clipRRect mutator contains the

0 commit comments

Comments
 (0)