Skip to content

Commit fd51c3a

Browse files
Merge pull request #45 from MrArtichaut/master
Use CGRectIntegral to avoid blurred content by MrArtichaut
2 parents f19470a + 7680756 commit fd51c3a

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

WYPopoverController/WYPopoverController.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ - (void)setViewController:(UIViewController *)viewController
763763
{
764764
contentView = viewController.view;
765765

766-
contentView.frame = CGRectMake(0, 0, self.bounds.size.width, 100);
766+
contentView.frame = CGRectIntegral(CGRectMake(0, 0, self.bounds.size.width, 100));
767767

768768
[self addSubview:contentView];
769769

@@ -775,7 +775,7 @@ - (void)setViewController:(UIViewController *)viewController
775775
navigationBarHeight = navigationController.navigationBar.bounds.size.height;
776776
}
777777

778-
contentView.frame = [self innerRect];
778+
contentView.frame = CGRectIntegral([self innerRect]);
779779

780780
if (innerView == nil)
781781
{
@@ -801,7 +801,7 @@ - (void)setViewController:(UIViewController *)viewController
801801

802802
[self insertSubview:innerView aboveSubview:contentView];
803803

804-
innerView.frame = contentView.frame;
804+
innerView.frame = CGRectIntegral(contentView.frame);
805805

806806
[self.layer setNeedsDisplay];
807807
}
@@ -1707,7 +1707,7 @@ - (void)positionPopover
17071707
containerFrame.size.width = MIN(maxX - minX, containerFrame.size.width);
17081708
containerFrame.size.height = MIN(maxY - minY, containerFrame.size.height);
17091709

1710-
containerView.frame = containerFrame;
1710+
containerView.frame = CGRectIntegral(containerFrame);
17111711

17121712
containerView.center = CGPointMake(viewFrame.origin.x + viewFrame.size.width / 2, viewFrame.origin.y + viewFrame.size.height / 2);
17131713

@@ -1806,7 +1806,7 @@ - (void)positionPopover
18061806
containerFrame.size.width = MIN(maxX - minX, containerFrame.size.width);
18071807
containerFrame.size.height = MIN(maxY - minY, containerFrame.size.height);
18081808

1809-
containerView.frame = containerFrame;
1809+
containerView.frame = CGRectIntegral(containerFrame);
18101810

18111811
containerView.center = CGPointMake(viewFrame.origin.x + viewFrame.size.width / 2, viewFrame.origin.y + viewFrame.size.height / 2);
18121812

@@ -1861,7 +1861,7 @@ - (void)positionPopover
18611861

18621862
containerView.center = CGPointMake(viewFrame.origin.x + viewFrame.size.width / 2, viewFrame.origin.y + viewFrame.size.height / 2);
18631863

1864-
containerFrame = containerView.frame;
1864+
containerFrame = CGRectIntegral(containerView.frame);
18651865

18661866
offset = containerView.frame.size.width / 2 + viewFrame.size.width / 2 - containerView.outerShadowInsets.left;
18671867

@@ -1905,7 +1905,7 @@ - (void)positionPopover
19051905
containerFrame.size = containerViewSize;
19061906
containerFrame.size.width = MIN(maxX - minX, containerFrame.size.width);
19071907
containerFrame.size.height = MIN(maxY - minY, containerFrame.size.height);
1908-
containerView.frame = containerFrame;
1908+
containerView.frame = CGRectIntegral(containerFrame);
19091909

19101910
containerView.center = CGPointMake(minX + (maxX - minX) / 2, minY + (maxY - minY) / 2);
19111911

@@ -1914,7 +1914,7 @@ - (void)positionPopover
19141914
containerView.arrowOffset = offset;
19151915
}
19161916

1917-
containerView.frame = containerFrame;
1917+
containerView.frame = CGRectIntegral(containerFrame);
19181918

19191919
containerView.wantsDefaultContentAppearance = wantsDefaultContentAppearance;
19201920

0 commit comments

Comments
 (0)