From f3166144500427ccc528e35686361350d576dfbf Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Apr 2023 10:52:45 +0200 Subject: [PATCH] Editor: fix selection path for empty selections Especially targets the painting of empty snippet replacement placeholder like in the default "if" snippet. Change-Id: I42d9fb901c66cddf4eab9dd7275b42a8f4e81282 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditoroverlay.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index bf320549de1..4a6eda6c2c4 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -134,8 +134,10 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co int x = line.cursorToX(pos); lineRect.setLeft(x - borderWidth); lineRect.setRight(x + borderWidth); + lineRect.setBottom(lineRect.bottom() + borderWidth); QPainterPath path; path.addRect(lineRect); + path.translate(offset); return path; }