Commit 25e608cb authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Don't use direct update together with anchors



Task-number: QTCREATORBUG-12584
Change-Id: I2649f43421e48863d002ae1db34ec5f2276fafd9
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent f83132a3
......@@ -91,6 +91,8 @@ public:
void setX(double x);
void setY(double y);
bool hasAnchors() const;
protected:
void setProperty(const PropertyName &name, const QVariant &value);
InformationName setInformation(InformationName name,
......
......@@ -144,7 +144,7 @@ void NodeInstance::setDirectUpdate(bool directUpdates)
bool NodeInstance::directUpdates() const
{
if (d)
return d->directUpdates && !(d->transform.isRotating() || d->transform.isScaling());
return d->directUpdates && !(d->transform.isRotating() || d->transform.isScaling() || hasAnchors());
else
return true;
}
......@@ -165,6 +165,19 @@ void NodeInstance::setY(double y)
}
}
bool NodeInstance::hasAnchors() const
{
return hasAnchor("anchors.fill")
|| hasAnchor("anchors.centerIn")
|| hasAnchor("anchors.top")
|| hasAnchor("anchors.left")
|| hasAnchor("anchors.right")
|| hasAnchor("anchors.bottom")
|| hasAnchor("anchors.horizontalCenter")
|| hasAnchor("anchors.verticalCenter")
|| hasAnchor("anchors.baseline");
}
bool NodeInstance::isValid() const
{
return instanceId() >= 0 && modelNode().isValid();
......
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