Commit ccc78ae9 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann

QmlDesigner.FormEditor: Disable Resize if the item is rotated

To workaround a qml design bug.

Change-Id: I44e681e0b35bde14269bbed1df0ba0d6cb038d2e
Reviewed-on: http://codereview.qt.nokia.com/849Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent e802690d
......@@ -77,6 +77,7 @@ void ResizeIndicator::setItems(const QList<FormEditorItem*> &itemList)
if (item
&& item->qmlItemNode().isValid()
&& item->qmlItemNode().instanceIsResizable()
&& !item->qmlItemNode().instanceHasRotationTransform()
&& !item->qmlItemNode().instanceIsInPositioner()) {
ResizeController controller(m_layerItem, item);
m_itemControllerHash.insert(item, controller);
......@@ -88,8 +89,12 @@ void ResizeIndicator::updateItems(const QList<FormEditorItem*> &itemList)
{
foreach (FormEditorItem* item, itemList) {
if (m_itemControllerHash.contains(item)) {
ResizeController controller(m_itemControllerHash.value(item));
controller.updatePosition();
if (item->qmlItemNode().instanceHasRotationTransform()) {
m_itemControllerHash.take(item);
} else {
ResizeController controller(m_itemControllerHash.value(item));
controller.updatePosition();
}
}
}
}
......
......@@ -74,6 +74,7 @@ public:
bool instanceIsMovable() const;
bool instanceIsResizable() const;
bool instanceIsInPositioner() const;
bool instanceHasRotationTransform() const;
QRectF instanceBoundingRect() const;
QRectF instancePaintedBoundingRect() const;
......
......@@ -219,6 +219,11 @@ bool QmlItemNode::instanceIsInPositioner() const
return nodeInstance().isInPositioner();
}
bool QmlItemNode::instanceHasRotationTransform() const
{
return nodeInstance().transform().type() > QTransform::TxScale;
}
QRectF QmlItemNode::instanceBoundingRect() const
{
return QRectF(QPointF(0, 0), nodeInstance().size());
......
Markdown is supported
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