-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Create overload of fillCircleHelper to be consistent with drawCircleHelper #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create overload of fillCircleHelper to be consistent with drawCircleHelper #486
Conversation
|
@ladyada for review. |
|
i really dislike anything with "bool useLegacy" - figure out another way? |
|
@ladyada I originally just modified fillCircleHelper itself, and updated fillCircle and fillRoundRect to account for the changes. Would you be comfortable with that approach? |
|
question: does this even really matter? what is the impact/can you just change the comments? |
|
@ladyada The problem is that the fillCircleHelper method doesn't draw quarter circles like the drawCircleHelper method. It only draws half circles. The brief for it says 'Quarter-circle drawer with fill' but it doesn't draw quarter circles, only half circles, left and right. My overload does draw individual quarter circles, just like the drawCircleHelper method does. It draws them filled. |
|
@ladyada I could take the bool out of the signature and rename the method 'fillQuarterCircleHelper'? |
|
lets just change the documentation - why mess with the code if it isnt needed |
|
@ladyada How do you draw a filled quarter circle? Like just the top left quadrant of a circle? |
|
@ladyada This method is needed as it adds functionality (the ability to fill quarter circles) that does not exist in the current implementation. |
|
@ladyada I'm going to close this PR and open two new ones. One to correct the documentation, the other to add a method that can actually fill quarter circles. |
The method fillCircleHelper is inconsistent with the drawCircleHelper method. The brief for fillCircleHelper suggests it can render quarter circle segments while only capable of rendering half circles, while the brief for drawCircleHelper inaccurately states it only supports two mask bits while actually supporting four, one for each quadrant.
This PR addresses these issues by creating an overload of fillCircleHelper to draw each corner independently. A boolean is added to the signature of the overloaded method (useLegacy) that, when true, uses the existing version of fillCircleHelper. When false, it uses a version of the code that is consistent with drawCircleHelper, at the cost of being slightly less efficient (four calls to writeFastVLine instead of two). This approach avoids breaking existing clients. The briefs for fillCircleHelper and drawCircleHelper have also been corrected to more accurately reflect their functionality.