From 3210f25cd58ef3f512762a6f9ff6bfc16ebca01d Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 2 Apr 2020 12:40:28 -0400 Subject: [PATCH] more arrow --- MVMCoreUI/Atomic/Atoms/Views/Arrow.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift b/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift index 23bd259d..cbd80839 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift @@ -106,27 +106,25 @@ open class Arrow: View { arrowLayer.transform = CATransform3DIdentity drawShapeLayer() - if let degrees = arrowModel?.degrees { - let radians = CGFloat(degrees * Float.pi / 180) - arrowLayer.transform = CATransform3DMakeRotation(-radians, 0.0, 0.0, 1.0) - } + let radians = CGFloat(degrees * Float.pi / 180) + arrowLayer.transform = CATransform3DMakeRotation(-radians, 0.0, 0.0, 1.0) } private func drawShapeLayer() { arrowLayer.frame = bounds - arrowLayer.strokeColor = isEnabled ? arrowModel?.color.cgColor : arrowModel?.disabledColor.cgColor + arrowLayer.strokeColor = isEnabled ? color.cgColor : disabledColor.cgColor arrowLayer.fillColor = UIColor.clear.cgColor arrowLayer.path = arrowPath() arrowLayer.lineJoin = .miter arrowLayer.lineCap = .butt - arrowLayer.lineWidth = arrowModel?.lineWidth ?? 1 + arrowLayer.lineWidth = lineWidth } private func arrowPath() -> CGPath { let length = max(bounds.size.height, bounds.size.width) - let inset = (arrowModel?.lineWidth ?? 1) / 2 + let inset = lineWidth / 2 let midLength = length / 2 var startPoint = CGPoint(x: midLength, y: inset)