Editor: skip painting selection path out of clip rect

Change-Id: Ieec7afbec729708884c24d8de2b4a6c488220a69
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2023-04-17 10:53:32 +02:00
parent f316614450
commit aa0c9bc741

View File

@@ -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);