@@ -1507,6 +1507,17 @@ - (void)testChildClippingViewShouldBeTheBoundingRectOfPlatformView {
1507
1507
SkMatrix finalMatrix;
1508
1508
finalMatrix.setConcat (screenScaleMatrix, rotateMatrix);
1509
1509
1510
+ // The childclippingview's frame is set based on flow, but the platform view's frame is set based
1511
+ // on quartz. Although they should be the same, we should tolerate small floating point
1512
+ // errors.
1513
+ // Push clip rects the same size as the platform view but faking a floating point error.
1514
+ SkRect clipRectSmaller =
1515
+ SkRect::MakeXYWH (0 , 0 , 300 - kFloatCompareEpsilon , 300 - kFloatCompareEpsilon );
1516
+ stack.PushClipRect (clipRectSmaller);
1517
+ SkRect clipRectLarger =
1518
+ SkRect::MakeXYWH (0 , 0 , 300 + kFloatCompareEpsilon , 300 + kFloatCompareEpsilon );
1519
+ stack.PushClipRect (clipRectLarger);
1520
+
1510
1521
auto embeddedViewParams =
1511
1522
std::make_unique<flutter::EmbeddedViewParams>(finalMatrix, SkSize::Make (300 , 300 ), stack);
1512
1523
@@ -1516,9 +1527,7 @@ - (void)testChildClippingViewShouldBeTheBoundingRectOfPlatformView {
1516
1527
toView: mockFlutterView];
1517
1528
XCTAssertTrue ([gMockPlatformView .superview.superview isKindOfClass: ChildClippingView.class ]);
1518
1529
ChildClippingView* childClippingView = (ChildClippingView*)gMockPlatformView .superview .superview ;
1519
- // The childclippingview's frame is set based on flow, but the platform view's frame is set based
1520
- // on quartz. Although they should be the same, but we should tolerate small floating point
1521
- // errors.
1530
+ // See above comment about tolerating small floating point errors.
1522
1531
XCTAssertLessThan (fabs (platformViewRectInFlutterView.origin .x - childClippingView.frame .origin .x ),
1523
1532
kFloatCompareEpsilon );
1524
1533
XCTAssertLessThan (fabs (platformViewRectInFlutterView.origin .y - childClippingView.frame .origin .y ),
@@ -1529,6 +1538,8 @@ - (void)testChildClippingViewShouldBeTheBoundingRectOfPlatformView {
1529
1538
XCTAssertLessThan (
1530
1539
fabs (platformViewRectInFlutterView.size .height - childClippingView.frame .size .height ),
1531
1540
kFloatCompareEpsilon );
1541
+
1542
+ XCTAssertNil (childClippingView.maskView );
1532
1543
}
1533
1544
1534
1545
- (void )testClipsDoNotInterceptWithPlatformViewShouldNotAddMaskView {
0 commit comments