This allows reflowing while taking into account the child size. I personally need this to be able to show a tooltip over a button (when hovered for a bit) that is nicely centered.
I introduced a new "Pivot" type to avoid accidentally swapping the anchor and the pivot arguments in the reflow shorthand.
Another idea: This could be implemented as a separate Pivot widget with the same offset logic.
Could also be added to the Offset widget which would now also take relative (pivot) coordinates.
(Could be worth simplifying Flow::Relative removing offset since the Offset widget can already do this?)
This allows reflowing while taking into account the child size. I personally need this to be able to show a tooltip over a button (when hovered for a bit) that is nicely centered.
I introduced a new "Pivot" type to avoid accidentally swapping the anchor and the pivot arguments in the
reflow
shorthand.Another idea: This could be implemented as a separate
Pivot
widget with the same offset logic. Could also be added to theOffset
widget which would now also take relative (pivot) coordinates. (Could be worth simplifyingFlow::Relative
removing offset since the Offset widget can already do this?)Some screenshots:
Backward compat: Pivot is![Screenshot from 2024-02-07 16-34-21](https://github.com/SecondHalfGames/yakui/assets/5420739/4b1173d5-dceb-461a-918e-c4906d1b0dd4)
TOP_LEFT
.Pivot is 'CENTER':![Screenshot from 2024-02-07 16-51-56](https://github.com/SecondHalfGames/yakui/assets/5420739/fd64931f-47bb-4465-b17f-c47dcc15b4a5)
Pivot is equal to anchor:![Screenshot from 2024-02-07 16-51-11](https://github.com/SecondHalfGames/yakui/assets/5420739/a7371aee-c6ce-4eb9-91fc-b2ce32bcbabc)