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. |
|
If there is still discussion to be had would it be worth landing without rotation and then we can discuss rotation and Aspect with a solid object that fills the space just like Rectangle? |
|
It can land without rotation, which can be added later if it works for you |
I think that makes sense - API that would impact many types need to be discussed in the bigger picture. (Polygon worked as an exception as the content is always inside the bounds, though maybe we should have discussed then). |
You're right, I removed |


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!