RSully / RSColorPicker

iOS color picker view with brightness control, opacity control, and delegation support.
Other
302 stars 77 forks source link

Assertion failed when cropToCircle is set NO and color picker view's outside is touched #4

Closed kenial closed 12 years ago

kenial commented 12 years ago

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;
                +    }
RSully commented 12 years ago

Thanks for the heads up, sorry I haven't had a chance to look at this project until recently. Not sure if this is still an issue but it may have been fixed already.