瀏覽代碼

Merge pull request #103063 from WinnerWind/fix-black-bars-in-minimap

Fix black bars appearing when using `background_color` on a TextEdit/CodeEdit.
Rémi Verschelde 6 月之前
父節點
當前提交
1fd8d7df2f
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      scene/gui/text_edit.cpp

+ 4 - 6
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;