litehtml: Fix selection artifacts with scaled view

If you zoom into a page (Ctrl-+) and then select, artifacts could be
left behind when dragging or removing the selection again.
Fiddle around with coordinate transformations (with regard to rounding)
to fix that.

Change-Id: I68c29d8e3559b90dbb3b93550338e483d14731bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-03-13 14:06:47 +01:00
parent 11bd2f8deb
commit 038e8491ee
3 changed files with 7 additions and 14 deletions

View File

@@ -998,8 +998,9 @@ QVector<QRect> DocumentContainer::mouseMoveEvent(const QPoint &documentPos,
viewportPos,
m_selection.mode);
if (element.element) {
redrawRects.append(
m_selection.boundingRect() /*.adjusted(-1, -1, +1, +1)*/); // redraw old selection area
m_selection.endElem = element;
redrawRects.append(m_selection.boundingRect()); // redraw old selection area
m_selection.update();
redrawRects.append(m_selection.boundingRect());
}