Repository: godotengine/godot (language: cpp)

Issue:
When using a background colour on a TextEdit, the Minimap has ugly black bars.
### Tested versions

- Reproducible in Godot 4.3 stable, 4.2 stable, 4.1 stable

### System information

Godot v4.3.stable unknown - Arch Linux #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 - X11 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 620 (KBL GT2) - Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 Threads)

### Issue description

Hi. 
I'm making a sort of detective game and I'm using a TextEdit node to store notes. I am using my own custom theme to make the TextEdit look consistent with the rest of the game. I asked for help in the [godot forums](https://godotforums.org/d/41932-ugly-black-bars-when-using-minimap-in-text-edit) and even on [reddit](https://www.reddit.com/r/godot/comments/1ihcbro/how_can_i_change_the_colour_of_the_lines_in_the/) but seeing as no one came for help, I assumed that it must be a bug and started to do some testing.

Without a theme, the Minimap looks okay and doesn't show these black bars. 

![Image](https://github.com/user-attachments/assets/e1f6e3b8-368c-4a6b-b5ab-0b3b6e45b23c)
![Image](https://github.com/user-attachments/assets/c52616d5-9ab7-479b-98f4-a517d6c871da)

I noticed that when turning on the Minimap setting in the TextEdit, black bars are seen in the editor, and even in the game. I have attached a screenshot.
![Image](https://github.com/user-attachments/assets/3f204f5a-e5d7-4813-a13c-c660678f3e1c)
This isn't horrible in dark mode, just an annoyance, but since I'm also designing a white version of my theme, these black bars make the Minimap unusable.
![Image](https://github.com/user-attachments/assets/6ab8be68-b966-48ea-af8e-81cee36e489f)

I did some testing and figured out that the problem lies in the `background_color` setting of the TextEdit. If it is set to anything but `#00000000` (Even changing the alpha triggers this) the black bars appear. See the reproduction steps.

### Steps to reproduce

This bug can be seen in a blank project.
- Create a new blank project with nothing in it.
- Make a TextEdit Node
- Enable the Minimap
- Add a new theme to it, preferably a blank one
- Override the TextEdit theme 
- Go to the colours tab in the Theme
- Change the background colour
- Note how the black bars appear for every line in the Minimap if the background colour is set to anything but `#00000000`
Video attached as a demonstration in an completely empty project.

https://github.com/user-attachments/assets/611596db-fc24-446c-b977-cf42a5bf4a13

### Minimal reproduction project (MRP)

[Broken Text Edit Demo.zip](https://github.com/user-attachments/files/18793715/Broken.Text.Edit.Demo.zip)
Not required but attached anyway. The bug can be demonstrated in any project.


Discussion / hints:
UPDATE : Managed to find a fix for this. Will open PR soon.

Fix patch:
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index ad2202315008..8db5886fd2d1 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -884,12 +884,10 @@ void TextEdit::_notification(int p_what) {
 
 					Color line_background_color = text.get_line_background_color(minimap_line);
 
-					if (line_background_color != theme_cache.background_color) {
-						// Make non-default background colors more visible, such as error markers.
-						line_background_color.a = 1.0;
-					} else {
-						line_background_color.a *= 0.6;
-					}
+					// Make non-default background colors more visible, such as error markers.
+					// If a line background color is being applied, like in an error marker, the alpha is set to 1.0.
+					// Else, it stays zero.
+					line_background_color.a = 1.0 * (line_background_color != Color(0, 0, 0, 0));
 
 					Color current_color = editable ? theme_cache.font_color : theme_cache.font_readonly_color;
 


Test patch: