From 03bf61be3c4a5e39adfdee97a12e48c53eb86785 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 27 Mar 2022 13:49:00 -0700 Subject: [PATCH] Fix drawing caret on GTK3 with GDK_SCALE=2 Don't use pen when drawing solid rectangle, avoids partial outline left on window. --- src/generic/caret.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/generic/caret.cpp b/src/generic/caret.cpp index 2be3938f6a..ff42b9e5c6 100644 --- a/src/generic/caret.cpp +++ b/src/generic/caret.cpp @@ -287,8 +287,16 @@ void wxCaret::DoDraw(wxDC *dc, wxWindow* win) brush = *wxWHITE_BRUSH; } } - dc->SetPen( pen ); - dc->SetBrush(m_hasFocus ? brush : *wxTRANSPARENT_BRUSH); + if (m_hasFocus) + { + dc->SetPen(*wxTRANSPARENT_PEN); + dc->SetBrush(brush); + } + else + { + dc->SetPen(pen); + dc->SetBrush(*wxTRANSPARENT_BRUSH); + } // VZ: unfortunately, the rectangle comes out a pixel smaller when this is // done under wxGTK - no idea why