Commit acd5ba99 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann
Browse files

QmlDesigner.FormEditor: Fix centering of the scene

Task-number: QTCREATORBUG-5336

Change-Id: Idc4b7a924725575b71450a82ec3e588c3c1cd797
Reviewed-on: http://codereview.qt.nokia.com/1546


Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 6b1f4267
......@@ -485,8 +485,6 @@ void FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeL
if (qmlItemNode.isValid() && scene()->hasItemForQmlItemNode(qmlItemNode)) {
scene()->synchronizeParent(qmlItemNode);
itemNodeList.append(scene()->itemForQmlItemNode(qmlItemNode));
if (qmlItemNode.isRootModelNode())
m_formEditorWidget->centerScene();
}
}
currentTool()->instancesCompleted(itemNodeList);
......@@ -500,8 +498,10 @@ void FormEditorView::instanceInformationsChange(const QMultiHash<ModelNode, Info
QmlItemNode qmlItemNode(node);
if (qmlItemNode.isValid() && scene()->hasItemForQmlItemNode(qmlItemNode)) {
scene()->synchronizeTransformation(qmlItemNode);
if (qmlItemNode.isRootModelNode())
if (qmlItemNode.isRootModelNode() && informationChangeHash.values(node).contains(Size)) {
widget()->setRootItemRect(qmlItemNode.instanceBoundingRect());
widget()->centerScene();
}
itemNodeList.append(scene()->itemForQmlItemNode(qmlItemNode));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment