Gui: Adapt...ToChildren using rounded values (adaptive scaling)

Hi,
in this playground with a StackPanel you can see that the Container has the wrong size, leading to the buttons being cut off by a small amount, when the widow size changed (upscaling). This seems to happen, because the buttons have values with many decimal places, e.g. 214.51612903225808px, but the container seems to cut off all decimal places, and uses 214px instead.

In the second playground example, you can see, that adaptHeightToChildren is set for the container and its’ height has all decimal places cutt off when it’s upscaled. The width on the other hand (because no adaptWidthToChildren is set) uses the exact values of both buttons added together (with decimal places).

I don’t know if the rounded values are the “correct” ones, or the exact ones, but it should be the same for all calculations.

Thanks

1 Like

Taking a look at the playgrounds, this seems to be caused by the adaptive scaling :thinking: I also noticed that, if I open the GUI editor from the Inspector, the cutoff disappears, probably because of some recalculation going on. I’ll ping @DarraghBurke so he is aware of this

If you open the GUI Editor from the inspector in the playground, the cutoff disappears because the values are set to the original non-scaled width/height, while the GUI Editor Window is open. If I close it, it resets to the upscaled ones, again showing the cutt off.

Hey, I am looking into this one now. We have not really decided on a consistent approach to rounding in the GUI system, so it’s going to take a little time to figure out what the right behavior is. Thank you for bringing this up! I will keep you posted on what we come up with.

1 Like