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