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

v2.x: Allow drawing filled concave polygons #442

Open
danngreen opened this issue Dec 25, 2024 · 0 comments
Open

v2.x: Allow drawing filled concave polygons #442

danngreen opened this issue Dec 25, 2024 · 0 comments

Comments

@danngreen
Copy link
Member

LVGL will go into an infinite loop if we try to draw a filled concave polygon. The current workaround is to check the polygon for concavity, and draw the outline instead of filling it if it's concave.

Unfortunately a convex polygon can become concave when it's scaled down and the points are rounded to the nearest integer pixel coordinate: it was a rounded rectangle with radius 2 corners that first alerted this to me.

Some ideas for solutions:

  • Use ThorVG or look into another polygon renderer
  • Split concave polygons into smaller polygons until none of them are concave, then draw them separately
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

1 participant