[2.0.73] LuaGuiElement "scroll-pane" with style "deep_scroll_pane" incorrectly renders scrollbar

Bugs that are actually features.
Data
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Nov 23, 2024 10:36 am
Contact:

[2.0.73] LuaGuiElement "scroll-pane" with style "deep_scroll_pane" incorrectly renders scrollbar

Post by Data »

Not sure if it's a bug, or I'm misusing API/base game assets, but here we go

What did you do?
  • Start the freeplay with default settings, no mods/space age dlc
  • Skip the cutscene
  • Run the command (twice to suppress achievements disable warning):

    Code: Select all

    /c
    local frame = game.player.gui.screen.add{ type = 'frame' }
    frame.style.size = 100
    local pane = frame.add{
        type = 'scroll-pane',
        style = 'deep_scroll_pane',
        vertical_scroll_policy = 'always',
        horizontal_scroll_policy = 'never',
    }
    pane.style.horizontally_stretchable = true
    pane.style.vertically_stretchable = true
  • Inspect the frame created at top left corner of the screen
What happened?
The frame contains scrollpane, but scrollbar offset too much to the right (see the screenshot attached)

What did you expect to happen instead?
Scrollbar should be within scrollpane

Does it happen always, once, or sometimes?
Always reproducible, style "deep_scroll_pane_with_padding" has the same scrollbar issue

If you run similar code snippet, but with the default style, scrollbar will have correct position (see also the screenshot):

Code: Select all

/c
local frame = game.player.gui.screen.add{ type = 'frame' }
frame.style.size = 100
local pane = frame.add{
    type = 'scroll-pane',
    vertical_scroll_policy = 'always',
    horizontal_scroll_policy = 'never',
}
pane.style.horizontally_stretchable = true
pane.style.vertically_stretchable = true
Attachments
deep_scroll_pane
deep_scroll_pane
Screenshot 2026-02-26 015002.png (1.35 KiB) Viewed 88 times
scroll_pane
scroll_pane
Screenshot 2026-02-26 015815.png (1.4 KiB) Viewed 88 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 16600
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.73] LuaGuiElement "scroll-pane" with style "deep_scroll_pane" incorrectly renders scrollbar

Post by Rseding91 »

Thanks for the report however this is not a bug. That style specifically has “scrollbars_go_outside = true” which does exactly what it says.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”