godot
godot copied to clipboard
TextEdit minimap adds an extra space for tab characters compared to spaces
Tested versions
Latest master at the time (0bcc0e92b3f0ac57d4c4650722f347593a258572)
System information
Pop!_OS 22.04 LTS - X11 - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)
Issue description
Minimap is supposed to treat each space as 1 pixel. But my tab size is 3, and the TextEdit minimap displays it like it's 4.
Steps to reproduce
The issue is most visible when you use Ctrl+Shift+Y and Ctrl+Shift+I to toggle between spaces and tabs for indents.
Minimal reproduction project (MRP)
N/A editor issue
For me it seems it's ok
Tab size 1:
Tab size 4:
Reading the code it seems uses the correct tab size too:
int minimap_tab_size = minimap_char_size.x * text.get_tab_size();
Oh, so I was misled.
Edited to reflect the actual issue.
I... took a look at the code, I have no clue what is causing this, it may be a matter of the renderer rounding floating-point numbers up.
- related to https://github.com/godotengine/godot/issues/72876