[0.10.3]GUI: inconsistent padding after changing window size

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

[0.10.3]GUI: inconsistent padding after changing window size

Post by Dark »

GUI reacts weirdly to changes in padding after changing game's window size (maximizing, full-screening, etc.).
Padding scale is affected by change of window size until GUI element is recreated.

Setup:
1. There is a custom frame, width/height fixed in styles, uses monolith background, dimensions are 200x200
2. Inside that frame(1) is another frame that uses standard "naked" style - on this frame padding is applied.
3. Inside naked frame (2) is a button with width/height fixed in styles, dimensions are 8x8, scalable=false, monolith.

Goal - position button(3) precisely in the center of frame(1).
Now weird behavior can be observed when changing leftpadding/toppadding of (2) on different window sizes:
  1. Start a game, window size is default, padding values for positioning button(3) in the center of frame(1) are (top=95, left=95).
  2. Maximize window (on 1080p), padding values for positioning dot in the center of frame(1) becomes (83, 83).
    You need to actually try setting the new padding value to see the inconsistency, nothing visually happens on window size change.
  3. Recreate GUI elements while game maximized - padding values of center back to (95, 95).

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.3]GUI: inconsistent padding after changing window

Post by kovarex »

Hello, could you please provide the lua code you used to do this?

How did you center the element, I don't see a way to center elements in our gui now, did you specify the paddings manually?

Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: [0.10.3]GUI: inconsistent padding after changing window

Post by Dark »

I set paddings manually.
It's not hard to center element assuming two conditions: padding values have fixed step and boundary is fixed.
My final goal is not centering UI but creating sorta compass and it actually works, but it limited to just one dot, don't seem to be possible to add more without insane positioning algo or ability to position elements absolutely, like in html.
The minimal test code would be
Before resize:
Image

After maximizing game's window and manually setting same padding:
Image

Note 1: it seems that fixed "radial" frame overflows it's monolith background in all directions for about 3-5 pixels and that overflow is hidden.
This can be noticed by adding black lines (1-2 pixel) on edges of compass.png, it could be another bug.

Note 2: if scalable is set to true on compass frame style then the bug still exists but it triggered immediately after resize. The padding values for center are also changed for some reason, values are reset after recreating UI elements.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.10.3]GUI: inconsistent padding after changing window

Post by cube »

I have no idea what I'm talking about.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.3]GUI: inconsistent padding after changing window

Post by kovarex »

Is it still happening in 0.11.15 ?

Post Reply

Return to “Pending”