tweak text highlight logic

This commit is contained in:
GenevensiS
2026-05-05 08:51:27 +02:00
parent 8a86778bfb
commit 9b51ca0537
+2 -2
View File
@@ -110,9 +110,9 @@ RealRect intersect(const RealRect& a, const RealRect& b) {
void TextViewer::drawSelection(RotatedDC& dc, const TextStyle& style, size_t sel_start, size_t sel_end) { void TextViewer::drawSelection(RotatedDC& dc, const TextStyle& style, size_t sel_start, size_t sel_end) {
if (sel_start == sel_end) return; if (sel_start == sel_end) return;
if (sel_end < sel_start) swap(sel_start, sel_end); if (sel_end < sel_start) swap(sel_start, sel_end);
dc.SetBrush(*wxBLACK_BRUSH); dc.SetBrush(*wxWHITE_BRUSH);
dc.SetPen(*wxTRANSPARENT_PEN); dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetLogicalFunction(wxINVERT); dc.SetLogicalFunction(wxXOR);
RealRect prev_rect(0,0,0,0); RealRect prev_rect(0,0,0,0);
FOR_EACH(l, lines) { FOR_EACH(l, lines) {
RealRect rect = l.selectionRectangle(dc, sel_start, sel_end); RealRect rect = l.selectionRectangle(dc, sel_start, sel_end);