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

Scale a circle to make an ellipse instead of Bezier curves #121

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

punchagan
Copy link
Contributor

The implementation is based on this Cairo cookbook recipe 1 that discusses drawing ellipses by scaling circles.

The implementation is based on this Cairo cookbook recipe [1] that discusses
drawing ellipses by scaling circles.

[1]: https://www.cairographics.org/cookbook/ellipses/
@nikochiko nikochiko merged commit 04396d7 into Sudha247:main Mar 11, 2024
0 of 2 checks passed
@nikochiko
Copy link
Collaborator

Thanks! @punchagan

@punchagan punchagan deleted the fix-ellipse branch March 11, 2024 12:41
punchagan added a commit to punchagan/ocaml-joy that referenced this pull request Mar 11, 2024
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 Sudha247#116 along with Sudha247#121.
punchagan added a commit to punchagan/ocaml-joy that referenced this pull request Mar 11, 2024
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 Sudha247#116 along with Sudha247#121.
nikochiko pushed a commit that referenced this pull request Mar 12, 2024
* Fix ellipse rotation to work correctly

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 along with #121.

* Add example with ellipse rotation
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