Merge pull request #91137 from ckaiser/fix-minimap-lightmode

Use TextEdit caret color for minimap highlight (fix minimap regression)
This commit is contained in:
Rémi Verschelde 2024-04-25 12:11:28 +02:00
commit 50a38cd1c2
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -752,16 +752,15 @@ void TextEdit::_notification(int p_what) {
// Draw the minimap.
// Add visual feedback when dragging or hovering the visible area rectangle.
float viewport_alpha;
Color viewport_color = theme_cache.caret_color;
if (dragging_minimap) {
viewport_alpha = 0.25;
viewport_color.a = 0.25;
} else if (hovering_minimap) {
viewport_alpha = 0.175;
viewport_color.a = 0.175;
} else {
viewport_alpha = 0.1;
viewport_color.a = 0.1;
}
const Color viewport_color = (theme_cache.background_color.get_v() < 0.5) ? Color(1, 1, 1, viewport_alpha) : Color(0, 0, 0, viewport_alpha);
if (rtl) {
RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(size.width - (xmargin_end + 2) - minimap_width, viewport_offset_y, minimap_width, viewport_height), viewport_color);
} else {