TextEditor: Simplify the overlay selection path

The algorithm that creates the overlay selection path adds many
redundant curve elements. That is quite ineffecient when painting and it
also creates visual gaps.

This patch simplifies the path and therefore substantially reduces the
elements and removes the gaps.

Task-number: QTCREATORBUG-18518
Change-Id: If3558e226825426ca6b143eeba4239e6f0061df0
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Alessandro Portale
2017-07-07 23:58:27 +02:00
parent 345ea0307c
commit e2ad4c282d

View File

@@ -307,7 +307,7 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co
} }
path.closeSubpath(); path.closeSubpath();
path.translate(offset); path.translate(offset);
return path; return path.simplified();
} }
void TextEditorOverlay::paintSelection(QPainter *painter, void TextEditorOverlay::paintSelection(QPainter *painter,