Skip to content
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

Same increment for arc filling and path #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergiandreplace
Copy link

The current calculation of radial increment is different for arc filling and drawing, making it very different in case of a low curveStepCount This change copies the increment calculation from drawing to filling for a better adjustment.

The current calculation of radial increment is different for arc filling and drawing, making it very different in case of  a low `curveStepCount` This change copies the increment calculation from drawing to filling for a better adjustment.
@@ -201,7 +201,7 @@ export function patternFillArc(x: number, y: number, width: number, height: numb
strt = 0;
stp = Math.PI * 2;
}
const increment = (stp - strt) / o.curveStepCount;
const increment = Math.min(Math.PI / o.curveStepCount, (stp - strt) / 2);
const points: Point[] = [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this makes it better. Filling needs a higher resolution than stroking. In stroking you are connected sampled points with a curve. When filling, we are approximating it to a polygon so a greater number of points is actually useful.
Perhaps I'm missing something. Can you share a sample where this makes it better? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants