You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-07 19:53:17 +00:00
The set_position method computes the anchors/offsets to match a rectangle at the given position with size "size_cache". However, when the Control's combined minimum size is larger than the size obtained through the offsets and anchors, "size_cache" is set to be as large as the combined minimum size. Therefore, when position is set while the combined minimum size is larger than the rectangle given by the anchors and offsets, it would resize these two fields, which would then stop the Control from shrinking when its combined minimum size decreased. To fix this, set_position now uses the size given by the offsets and anchors instead of the "size_cache" field. This way, the rectangle denoted by the offsets and anchors is simply moved, without being resized, enabling the Control to shrink automatically when its combined minimum size decreases. I also added a test case to ensure that the Control shrinks correctly after setting its position while it has a larger custom minimum size than the one obtained through the offsets and anchors.