Sudha247 / ocaml-joy

MIT License
21 stars 14 forks source link

Fix ellipse rotation to work correctly #126

Closed punchagan closed 4 months ago

punchagan commented 4 months ago

Previously, we only rotated the center of the ellipse, similar to the circle. This commit adds a rotation field to the ellipse shape type which stores the rotation of the ellipse in radians. And we use Cairo's rotate function when rendering the ellipse.

Fixes #116 (in combination with #121, which has been merged)

This PR also adds an example for ellipse rotation.

rotate_ellipse

The rectangle at the top right corner has been added to show that these rotations don't affect anything that's already been rendered.