diff options
author | David Schulz <david.schulz@qt.io> | 2023-04-17 10:52:45 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2023-04-18 12:44:21 +0000 |
commit | f3166144500427ccc528e35686361350d576dfbf (patch) | |
tree | d9beeafa74a73125c278c46736ca5f7638cbe6bd | |
parent | c3715883ee6223d8bc4d7ca10b0783d629e68577 (diff) |
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 <christian.stenger@qt.io>
-rw-r--r-- | src/plugins/texteditor/texteditoroverlay.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index bf320549de..4a6eda6c2c 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; } |