godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.02k stars 21.17k forks source link

Godot Editor cutting off certain characters with vertical lines #92238

Open MM4096 opened 5 months ago

MM4096 commented 5 months ago

Tested versions

Reproduced in 4.2

System information

Godot v4.2.2.stable.mono - Ubuntu 23.10 23.10 - Wayland - Vulkan (Forward+) - integrated Intel(R) HD Graphics 4400 (HSW GT2) () - Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz (4 Threads)

Issue description

Vertical lines in the script editor cuts off letters on that line (see image for example). I don't know why the lines are there (maybe preferred line length, like in Python?)

The vertical line seems to overwrite the lines of the letters. This only applies to small font sizes, where I assume the width of a vertical line is either smaller or equal to the width of a vertical line. image

Steps to reproduce

Open a new text file, start typing until lines appear, zoom out until the vertical line cuts off letters.

Minimal reproduction project (MRP)

N/A

kitbdev commented 5 months ago

The lines are supposed to be in between characters, but it looks like it may not be rounding correctly. However, if the font size is too small it still won't have space. You can disable them in the Editor Settings at text_editor/appearance/guidelines/show_line_length_guidelines. Or you can change the text_editor/theme/highlighting/line_length_guideline_color color to be transparent.

Calinou commented 5 months ago

The line length guidelines are supposed to be drawn behind text, but they appear in front of the text for some reason.

kitbdev commented 5 months ago

They are on top of the text since TextEdit draws the background and the text first and then CodeEdit draws after. We would need to move it into TextEdit in order for it to be between the background and text, but it was moved out of TextEdit in #50122. Maybe an virtual method can be added to draw in between the background and text?