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>
This commit is contained in:
David Schulz
2023-04-17 10:52:45 +02:00
parent c3715883ee
commit f316614450

View File

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