From 44bd74c6836f8f086cebd173770485e89ee01f2e Mon Sep 17 00:00:00 2001 From: "Robinson, Blake" Date: Wed, 18 Mar 2020 11:27:37 -0400 Subject: [PATCH] Makes drawBottomCurvedShadowsOnRect more flexible by allowing the rect to be passed in with a non (0,0) origin --- MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m b/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m index 4a21b1a5..5c796417 100644 --- a/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m @@ -260,15 +260,15 @@ static const CGFloat VertialShadowOffset = 6; UIBezierPath *shadowPath = [UIBezierPath bezierPath]; //get the variables for frame - CGFloat x = 0; - CGFloat y = 0; + CGFloat x = rect.origin.x; + CGFloat y = rect.origin.y; CGFloat width = CGRectGetWidth(rect); CGFloat height = CGRectGetHeight(rect); [shadowPath moveToPoint:CGPointMake(x + HorizontalShadowInset, y)]; - [shadowPath addLineToPoint:CGPointMake(width - HorizontalShadowInset, y)]; - [shadowPath addLineToPoint:CGPointMake(width - HorizontalShadowInset, height-VertialShadowOffset/2)]; - [shadowPath addQuadCurveToPoint:CGPointMake(x + HorizontalShadowInset, height - VertialShadowOffset/2) controlPoint:CGPointMake(width/2.f, height - VertialShadowOffset * 1.5)]; + [shadowPath addLineToPoint:CGPointMake(x + width - HorizontalShadowInset, y)]; + [shadowPath addLineToPoint:CGPointMake(x + width - HorizontalShadowInset, height-VertialShadowOffset/2)]; + [shadowPath addQuadCurveToPoint:CGPointMake(x + HorizontalShadowInset, height - VertialShadowOffset/2) controlPoint:CGPointMake((x + width)/2.f, height - VertialShadowOffset * 1.5)]; [shadowPath addLineToPoint:CGPointMake(x + HorizontalShadowInset, y)]; [shadowPath closePath];