diff options
author | David Schulz <david.schulz@qt.io> | 2023-04-17 10:53:32 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2023-04-18 12:52:41 +0000 |
commit | aa0c9bc741091f2212955bc3f9dc7d20116c6f9c (patch) | |
tree | 78a6658fd886d73cb0ed6e5bb0af3ee855165988 | |
parent | f3166144500427ccc528e35686361350d576dfbf (diff) |
Editor: skip painting selection path out of clip rect
Change-Id: Ieec7afbec729708884c24d8de2b4a6c488220a69
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | src/plugins/texteditor/texteditoroverlay.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 4a6eda6c2c..52ab8709de 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -252,6 +252,8 @@ void TextEditorOverlay::paintSelection(QPainter *painter, return; QPainterPath path = createSelectionPath(begin, end, clip); + if (path.isEmpty()) + return; painter->save(); QColor penColor = fg; @@ -307,6 +309,8 @@ void TextEditorOverlay::fillSelection(QPainter *painter, return; QPainterPath path = createSelectionPath(begin, end, clip); + if (path.isEmpty()) + return; painter->save(); painter->translate(-.5, -.5); |