From 6cb04c49847e484696adb0b585ec8014ad04a0fc Mon Sep 17 00:00:00 2001 From: WinnerWind Date: Thu, 20 Feb 2025 13:04:12 +0530 Subject: [PATCH] Fix evaluation of line_background_color in minimap Fixes #102844 by evaluating the line_background_color in a smarter way. The previous check would cause black bars appearing when a background_color was set in the theme of a TextEdit or CodeEdit. This tackles that issue, by checking if line_background_color is set at all, and does not set alpha if no color is set. --- scene/gui/text_edit.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ad22023150..8db5886fd2 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;