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