mirror of
https://github.com/joncardasis/ChromaColorPicker.git
synced 2024-12-01 18:17:49 +03:00
Color wheel now adjusts bounds with proper sizing function for point determination
This commit is contained in:
parent
46e2743d87
commit
b2b504081a
@ -91,7 +91,7 @@ public class ColorWheelView: UIView {
|
||||
Returns whether or not the point is in the circular area of the color wheel.
|
||||
*/
|
||||
public func pointIsInColorWheel(_ point: CGPoint) -> Bool {
|
||||
guard bounds.offsetBy(dx: 1, dy: 1).contains(point) else { return false }
|
||||
guard bounds.insetBy(dx: -1, dy: -1).contains(point) else { return false }
|
||||
|
||||
let distanceFromCenter: CGFloat = hypot(center.x - point.x, center.y - point.y)
|
||||
let pointExistsInRadius: Bool = distanceFromCenter <= (radius - layer.borderWidth)
|
||||
|
Loading…
Reference in New Issue
Block a user