godotengine / godotengine/godot
When Base Spacing < 3, screen moves a few pixels every time a Control is selected or deselected
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in v4.5.1.stable.flathub [f62fdbde1]
### System information
Godot v4.5.1.stable (f62fdbde1) - Freedesktop SDK 25.08 (Flatpak runtime) on Wayland - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - Mesa Intel(R) HD Graphics 5500 (BDW GT2) - Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (4 threads) - 10.59 GiB memory
### Issue description
In Editor settings, when `interface/theme/base_spacing` is set to 2 or less, there's a GUI issue where the screen e.g. in 2D mode keeps shifting 1 or a few pixels every time a node like a control is selected or deselected. It took me a while to figure out this setting is the cause - it seems to be caused by the additional buttons that appear in the toolbar when certain node types are selected.
I set it to 0 here to make the issue more visible:
Again, the issue is not really the toolbar being resized, but how it causes the screen below to be resized and shift a pixel down every selection and up again every deselection. This makes the setting unusable, which is very disappointing, as I want to set it to 2 because I really dislike extra unnecessary space being wasted in GUI. I want small buttons to maximize my useful work area.
To solve this, you can either:
- (preferably) fix these additional buttons so they respect the setting and not change the spacing, or
- fix the logic so toolbar resizes don't make the screen below it shift (e.g. by compensating the shift somehow), or
- if not possible, make the toolbar a fixed size by the max height, i.e. it always has space for the selection-specific buttons even when they're not there, so it doesn't resize based on what is or isn't there
### Steps to reproduce
1. In Editor settings, set `interface/theme/base_spacing` to 2 or less (set to 0 to make the issue more visible).
2. Open a scene with control nodes in 2D view mode.
3. You may want to have a background image to see the issue better. Press Shift+F to frame-resize to it.
4. Select a control node and deselect it to see the screen editing pan/position shift by 1 pixel (if set to 2) or more (if set to 0). Note how this is caused by the toolbar being resized. If set to 3 or more, the issue doesn't seem to happen.
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start by reproducing the editor behavior with interface/theme/base_spacing set to 0 or 2, then compare the 2D view while selecting and deselecting Control nodes. Trace the selection-specific toolbar resizing and determine how the viewport shift can be prevented; done means selection no longer moves the view at low spacing values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- desktop, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100