From 7101804428e4568abc71982507c537cfb8d064b3 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Mon, 1 Apr 2024 12:22:24 +0200 Subject: [PATCH] Fix single empty line selection drawing --- Quake/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Quake/console.c b/Quake/console.c index 33346ad62..16bfbff87 100644 --- a/Quake/console.c +++ b/Quake/console.c @@ -2284,9 +2284,6 @@ void Con_DrawSelectionHighlight (int x, int y, int line) end.line = line; end.col = len; - if (!Con_IntersectRanges (&begin, &end, &selbegin, &selend)) - return; - // Highlight line ends (as in Notepad, Visual Studio etc.) if (end.line != selend.line && end.col == len) end.col++; @@ -2294,6 +2291,9 @@ void Con_DrawSelectionHighlight (int x, int y, int line) // ...unless we would end up overlapping the console margin end.col = q_min (end.col, con_linewidth); + if (!Con_IntersectRanges (&begin, &end, &selbegin, &selend)) + return; + Draw_Fill (x + begin.col*8, y, (end.col-begin.col)*8, 8, 220, 1.f); }