QmlDesigner: Fix magic move offset

There is a magic offset that increases the move tool hitbox.
We should take the zoom factor into account.

Change-Id: Ib2ebb310100aa9e5ba5102e9b44d4a38f6187ced
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2020-02-04 17:06:05 +01:00
parent f61c75c454
commit e68e7f723e

View File

@@ -149,7 +149,8 @@ bool AbstractFormEditorTool::selectedItemCursorInMovableArea(const QPointF &pos)
QRectF innerRect = boundingRect;
innerRect.adjust(2, 2, -2, -2);
boundingRect.adjust(-2, -20, 2, 2);
const int heightOffset = -20 / scene()->formLayerItem()->viewportTransform().m11();
boundingRect.adjust(-2, heightOffset, 2, 2);
return !innerRect.contains(pos) && boundingRect.contains(pos);
}