-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: Ellipse canvas #5972
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
base: develop
Are you sure you want to change the base?
feat: Ellipse canvas #5972
Conversation
|
The way this works to get size from the space and then rotates such that non-horizontal will probably be clipped doesn't seem intuitive. Perhaps the rotation should always fit in the space - would that lead to the shape always fitting inside the space instead of being framed by the rotated rectangle? From a mathematical point Ellipse has 2 focal points so the ratio of width to height can be customised - should that be here too perhaps? I think all of those points inter-relate and the idea of exactly how the shape is defined may relate to how it fits in the space. |
You're quire right sorry about that. However for consistency with the other graphical primitives that draw inside their space (with some documenting that they are clipped outside that area) it still seems a little unexpected. If we compare directly with (p.s. there is still the question of whether this truly is an ellipse based on the lack of focus points). |
|
Good question, currently the To keep Ellipse inside the requested size, larger radius cannot exceed
The two radii and focus points of an ellipse define the same shape, focus points can be calculated based on the radii (semi-major and semi-minor axis). The radii (X, Y) are set to half the width and height of the canvas size, software painter |
That is a good point, thanks.
Yes it could reflect how Rectangle works. However it seems that if we only allow the minimum then a wide, short ellipsis will not be possible I don't think. In the future Aspect could be useful for overriding the aspect to use a smaller area than the full (like Rectangle.Aspect now). This is a thinker... I wonder, as a thought exercise, what would the expected behaviour be if we support rotation of a rectangle at some point... we can use that to set an expectation for rotation of non-square (boundary) items...
Ah, OK - thanks for that. |


Description:
As per #856, #2632 issues
This PR introduces a new
canvas.Ellipseobject to Fyne. The radii (X, Y) are set to half the width and height of the canvas size.The Ellipse object supports:
Examples:

Checklist:
Where applicable:
Please review and provide feedback!