forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user