Skip to content

Commit

Permalink
Fix single empty line selection drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Apr 1, 2024
1 parent c887336 commit 7101804
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Quake/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,16 +2284,16 @@ 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++;

// ...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);
}

Expand Down

0 comments on commit 7101804

Please sign in to comment.