From 927a4d88349164881bb33b33ffd7d52719736b10 Mon Sep 17 00:00:00 2001 From: Jonathan Cardasis Date: Fri, 12 Apr 2019 00:22:56 -0400 Subject: [PATCH] Expand bounds for 'contains' to account for points on the rightmost and bottommost bounds. --- Source/ColorWheelView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ColorWheelView.swift b/Source/ColorWheelView.swift index b6ce850..e0fc9a8 100644 --- a/Source/ColorWheelView.swift +++ b/Source/ColorWheelView.swift @@ -56,7 +56,7 @@ public class ColorWheelView: UIView { the point does not exist within the bounds of the color wheel. */ public func pixelColor(at point: CGPoint) -> UIColor? { - guard bounds.contains(point) else { return nil } + guard bounds.offsetBy(dx: 1, dy: 1).contains(point) else { return nil } let distanceFromCenter: CGFloat = hypot(center.x - point.x, center.y - point.y) let pointExistsInRadius: Bool = distanceFromCenter <= radius