[1.1.80] Layout bug with nested frames and stretching

We are aware of them, but do not have solutions that don't cause other issues. They go here in order not to take space in the main bug thread list.
User avatar
BiterUnion
Inserter
Inserter
Posts: 21
Joined: Fri Aug 19, 2022 7:58 am
Contact:

[1.1.80] Layout bug with nested frames and stretching

Post by BiterUnion »

I have already posted this in Modding help (viewtopic.php?f=25&t=105879), but it did not get any answers and might be bug, so I am reposting here. Please feel free to delete this post, if that is not allowed.

I have two nested frames (outer_frame and inner_frame) and am trying to understand how horizontally_stretchable changes the layout, when setting it on inner_frame:

Code: Select all

local window = player.gui.screen.add {
    type = 'frame'
}
window.style.size = 150
window.force_auto_center()

local outer_frame = window.add {
    type = 'frame',
    style = 'inside_shallow_frame_with_padding'
}
outer_frame.style.horizontally_stretchable = true
outer_frame.style.vertically_stretchable = true

local inner_frame = outer_frame.add {
    type = 'frame',
    style = 'deep_frame_in_shallow_frame'
}
inner_frame.style.natural_width = 50
inner_frame.style.maximal_width = 70
inner_frame.style.horizontally_stretchable = true  -- this is the line I am talking about
inner_frame.style.vertically_stretchable = true
Without setting inner_frame.style.horizontally_stretchable = true, the frames look as I would expect it:

Image

The inner frame has its natural width and stretches vertically and the outer frame completely fills the window. However, when I set inner_frame.style.horizontally_stretchable = true, it looks like this:

Image

The inner frame behaves as expected (it stretches to its maximal width), but the outer frame no longer stretches to the full width of the window. I would expect for the outer frame to stay the same (i.e. fill the window completely), as I have only changed the stretching behavior of the inner frame. What's also making me think this might be a bug is that I can add direction = 'vertical' to the outer frame, and that causes the outer frame to completely fill the window again.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 807
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [1.1.80] Layout bug with nested frames and stretching

Post by raiguard »

Might be related to 100896.
Don't forget, you're here forever.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17033
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.80] Layout bug with nested frames and stretching

Post by Rseding91 »

Unfortunately nobody is willing to take the time to investigate this and so I'm going to move this to minor issues.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Minor issues”