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

Draw arcs, arcs are not smooth, please confirm whether you can support arcs to be more smooth #23

Open
pcbren1987 opened this issue Sep 20, 2022 · 2 comments

Comments

@pcbren1987
Copy link

Draw arcs, arcs are not smooth, please confirm whether you can support arcs to be more smooth
image

@dev7355608
Copy link
Collaborator

Don't you get the same results with PIXI.Graphics? The number of segments the arc is build from is defined by PIXI.GRAPHICS_CURVES._segmentsCount.

@MuTsunTsai
Copy link

MuTsunTsai commented Mar 10, 2023

@dev7355608 This is helpful info. However I noticed that when I call drawRoundedRect or drawCircle, the method now called Graphics.curves._segmentsCount is never called. Is there a way I can make it work for these two methods?

Update: after some digging, I realized that the key is in this part,

https://github.com/pixijs/graphics-smooth/blob/93493e18d466ee6bb683714a8aa6a06a36bc5f68/src/shapes/CircleBuilder.ts#L67-L68

where the number of segments is determined solely by the radius. However such an approach fails to consider coordinate transformations. If the local coordiantes are scaled up a lot, the circles will have relatively small radii, leading to very few segments and bad result. Could you guys do something about this? (My current workaround is to apply additional scaling down on those circle and increase their radii respectively.)

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

No branches or pull requests

3 participants