diff --git a/RSColorPicker/ColorPickerClasses/RSColorPickerView.m b/RSColorPicker/ColorPickerClasses/RSColorPickerView.m index db012e2..503d7ab 100755 --- a/RSColorPicker/ColorPickerClasses/RSColorPickerView.m +++ b/RSColorPicker/ColorPickerClasses/RSColorPickerView.m @@ -403,6 +403,17 @@ - (RSColorPickerState *)stateForPoint:(CGPoint)point { return newState; } +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { + if (!self.cropToCircle) { + return [super pointInside:point withEvent:event]; + } + + CGFloat X = point.x - CGRectGetMidX(self.bounds); + CGFloat Y = point.y - CGRectGetMidY(self.bounds); + CGFloat r = sqrt(pow(X, 2) + pow(Y, 2)); + return [super pointInside:point withEvent:event] && r < self.paletteDiameter / 2; +} + - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if (self.showLoupe) {