RSully/RSColorPicker — Issue #4: Assertion failed when cropToCircle is set NO and color picker view's outside is touched
Author: kenial
Created: 2011-11-29 03:58:12+00:00
State: open

IMO, validPointForTouch: in RSColorPickerView.m should be fixed like this :

-(CGPoint)validPointForTouch:(CGPoint)touchPoint {
-	if (!cropToCircle) return touchPoint;
+	if (!cropToCircle)
+ {
+ if(touchPoint.x < 0) touchPoint.x = 0;
+ if(touchPoint.y < 0) touchPoint.y = 0;
+ if(touchPoint.x > self.frame.size.width) touchPoint.x = self.frame.size.width-0.1;
+ if(touchPoint.y > self.frame.size.height) touchPoint.y = self.frame.size.height-0.1;
+ return touchPoint;
+ }