Add Automatic Pivot Offset Adjustment to Control Node
Automatically adjusted pivot offset using percent.
This PR adds a new feature that lets a Control node's pivot offset be automatically adjusted. Two more variables, pivot_offset_percent and pivot_mode, can be used to govern the adjustment.
pivot_mode:
- PIVOT_MODE_PIXEL: Godot pivot offset in basic form
- PIVOT_MODE_PERCENT: To modify the pivot offset depending on the control size, use a percent between 0 and 1 (more or less is allowed).
pivot_offset_percent:
This variable represent the offset percent of the pivot point. Example:
pivot_offset_percent = (0.5, 0.5)
size = (100.0, 100.0)
pivot_offset will be set to (50, 50)
In Editor
It works but has the same issue as https://github.com/godotengine/godot/pull/70646#issuecomment-2002652414 It's probably better to call it ratio, it shows 0.5% in the UI now
Also doesn't work with clip_contents but I believe that's a separate issue.
It works but has the same issue as #70646 (comment) It's probably better to call it ratio, it shows 0.5% in the UI now
Thank you for the responses ! I'll take you feedbacks into count.
Also doesn't work with
clip_contentsbut I believe that's a separate issue.
What is exactly not working ? How do you recreate it ?
Just rotate a Control with clip_contents enabled.
Support for rotation with Control nodes is just limited at the moment, so this PR doesn't hurt, but it should still be avoided if clip_contents is enabled.
but I believe that's a separate issue.
Yes: #20671
would love to see this feature in engine :)
Can't wait to see this in the engine!
Why has this been closed?