In the method linked above, get_minimum_size method is used instead of combined minimum size, resulting in erroneous offset state after method call. Other methods that call this method with preset mode other than PRESET_MODE_KEEP_SIZE, notably set_anchors_and_offsets_preset, may also be affected by this issue.
Steps to reproduce
Try to call the method on control with custom minimum size.
Simple side-by-side setup showing two rectangles being programmatically aligned with set_anchors_preset and set_offsets_preset call on _ready. (This is essentially identical to calling set_anchors_and_offsets_preset.) White area show the intended position of the rectangles getting aligned.
The red rectangle has custom min size of (100, 100) and default min size. The blue rectangle has no custom min size, but has min size of (100, 100) defined in code. The blue one is able to produce desired result, while the red one produces odd behavior.
Tested versions
v4.3.stable.mono.official [77dcf97d8]
System information
archlinux
Issue description
Relevant code
In the method linked above,
get_minimum_size
method is used instead of combined minimum size, resulting in erroneous offset state after method call. Other methods that call this method with preset mode other thanPRESET_MODE_KEEP_SIZE
, notablyset_anchors_and_offsets_preset
, may also be affected by this issue.Steps to reproduce
Try to call the method on control with custom minimum size.
Minimal reproduction project (MRP)
offset-thing.zip
Simple side-by-side setup showing two rectangles being programmatically aligned with
set_anchors_preset
andset_offsets_preset
call on_ready
. (This is essentially identical to callingset_anchors_and_offsets_preset
.) White area show the intended position of the rectangles getting aligned.The red rectangle has custom min size of (100, 100) and default min size. The blue rectangle has no custom min size, but has min size of (100, 100) defined in code. The blue one is able to produce desired result, while the red one produces odd behavior.