Page 1 of 1

What does "scalable" in style prototype do?

Posted: Thu Sep 15, 2016 5:22 pm
by Mooncat
Hi, everyone,

Does anyone know what does the "scalable" property in style prototype actually do?

During the last update of my Color Picker mod, I added the Hex field under the RGB fields. The UI alignment nearly drove me nuts. It spent me most of the time to fix the alignment so I can capture a nice screenshot for publish.

But, less than a minute after I clicked the submit button, I realized the alignment is complete wrong if I resize the Factorio's window (I play in windowed mode). It becomes this when Factorio is in fullscreen:
Before
<<Insert multiple GIFs from Factorio development explained in gifs>>

Then I spent hours trying to fix this problem. The solution I came up with is to spam "scalable = false" in the style prototypes. Now, the alignment looks really good. It doesn't change no matter how I resize Factorio's window.
After
Therefore, I wonder why "scalable = false" is not the default value. Do I lose something if I set it to false?
I know it has nothing to do with Options - UI Scale. But is my solution safe?

Edit: I decided to release the fixed version first. So, the alignment problem was in Color Picker v0.2.0, and it is fixed in v0.2.1.

Re: What does "scalable" in style prototype do?

Posted: Thu Sep 15, 2016 6:04 pm
by aubergine18
Which styles have you tested the scalable property with? I've only ever seen it mentioned in button_style prototypes and though originally that it was something to do with making button scale to fit its caption or sprite, but looking at your stuff above it seems it's more about making UI elements not scale with window size changes...

Re: What does "scalable" in style prototype do?

Posted: Thu Sep 15, 2016 6:35 pm
by Mooncat
buttons, labels, textfields, flows (maybe unnecessary), tabels (unnecessary either?)
Basically, everything except the frame.

Yea, I thought it is about button size only too when I first saw this property. But turns out it is not. :?

Re: What does "scalable" in style prototype do?

Posted: Thu Sep 15, 2016 6:44 pm
by aubergine18
I'll add it to all non-flow/frame style types in the Style mod and have it default to true for container elements and false for all others.