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

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/849

Reviewed-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) ...@@ -77,6 +77,7 @@ void ResizeIndicator::setItems(const QList<FormEditorItem*> &itemList)
if (item if (item
&& item->qmlItemNode().isValid() && item->qmlItemNode().isValid()
&& item->qmlItemNode().instanceIsResizable() && item->qmlItemNode().instanceIsResizable()
&& !item->qmlItemNode().instanceHasRotationTransform()
&& !item->qmlItemNode().instanceIsInPositioner()) { && !item->qmlItemNode().instanceIsInPositioner()) {
ResizeController controller(m_layerItem, item); ResizeController controller(m_layerItem, item);
m_itemControllerHash.insert(item, controller); m_itemControllerHash.insert(item, controller);
...@@ -88,8 +89,12 @@ void ResizeIndicator::updateItems(const QList<FormEditorItem*> &itemList) ...@@ -88,8 +89,12 @@ void ResizeIndicator::updateItems(const QList<FormEditorItem*> &itemList)
{ {
foreach (FormEditorItem* item, itemList) { foreach (FormEditorItem* item, itemList) {
if (m_itemControllerHash.contains(item)) { if (m_itemControllerHash.contains(item)) {
ResizeController controller(m_itemControllerHash.value(item)); if (item->qmlItemNode().instanceHasRotationTransform()) {
controller.updatePosition(); m_itemControllerHash.take(item);
} else {
ResizeController controller(m_itemControllerHash.value(item));
controller.updatePosition();
}
} }
} }
} }
......
...@@ -74,6 +74,7 @@ public: ...@@ -74,6 +74,7 @@ public:
bool instanceIsMovable() const; bool instanceIsMovable() const;
bool instanceIsResizable() const; bool instanceIsResizable() const;
bool instanceIsInPositioner() const; bool instanceIsInPositioner() const;
bool instanceHasRotationTransform() const;
QRectF instanceBoundingRect() const; QRectF instanceBoundingRect() const;
QRectF instancePaintedBoundingRect() const; QRectF instancePaintedBoundingRect() const;
......
...@@ -219,6 +219,11 @@ bool QmlItemNode::instanceIsInPositioner() const ...@@ -219,6 +219,11 @@ bool QmlItemNode::instanceIsInPositioner() const
return nodeInstance().isInPositioner(); return nodeInstance().isInPositioner();
} }
bool QmlItemNode::instanceHasRotationTransform() const
{
return nodeInstance().transform().type() > QTransform::TxScale;
}
QRectF QmlItemNode::instanceBoundingRect() const QRectF QmlItemNode::instanceBoundingRect() const
{ {
return QRectF(QPointF(0, 0), nodeInstance().size()); return QRectF(QPointF(0, 0), nodeInstance().size());
......
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