Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control::set_offsets_preset ignores custom minimum size of the control #98186

Open
Tictim opened this issue Oct 14, 2024 · 1 comment
Open

Control::set_offsets_preset ignores custom minimum size of the control #98186

Tictim opened this issue Oct 14, 2024 · 1 comment

Comments

@Tictim
Copy link

Tictim commented Oct 14, 2024

Tested versions

v4.3.stable.mono.official [77dcf97]

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 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.

Minimal reproduction project (MRP)

offset-thing.zip

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.

Screenshot_20241015_053214

@Gurka2
Copy link

Gurka2 commented Oct 17, 2024

I would like to give this issue a try, seems like a good first issue for me 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants