Commit b90cb496 authored by Marco Bubke's avatar Marco Bubke
Browse files

Set the width or height of the root item to 100 if there is no width or

height

Task-number: BAUHAUS-291
parent 790e987f
......@@ -597,7 +597,7 @@ QRectF NodeInstanceView::boundingRect() const
QRectF NodeInstanceView::sceneRect() const
{
if (m_graphicsView)
return m_graphicsView->sceneRect();
return rootNodeInstance().boundingRect();
return QRectF();
}
......
......@@ -107,6 +107,14 @@ QSizeF QmlGraphicsItemNodeInstance::size() const
}
if (modelNode().isRootNode()) {
if (!m_hasWidth)
qmlGraphicsItem()->setWidth(100.);
if (!m_hasHeight)
qmlGraphicsItem()->setHeight(100.);
}
return QSizeF(qmlGraphicsItem()->width(), qmlGraphicsItem()->height());
}
......@@ -127,6 +135,14 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const
}
if (modelNode().isRootNode()) {
if (!m_hasWidth)
qmlGraphicsItem()->setWidth(100.);
if (!m_hasHeight)
qmlGraphicsItem()->setHeight(100.);
}
return qmlGraphicsItem()->boundingRect();
}
......@@ -237,6 +253,13 @@ int QmlGraphicsItemNodeInstance::penWidth() const
void QmlGraphicsItemNodeInstance::resetProperty(const QString &name)
{
if (name == "height")
m_hasHeight = false;
if (name == "width")
m_hasWidth = false;
GraphicsObjectNodeInstance::resetProperty(name);
if (name == "anchors.fill") {
qmlGraphicsItem()->anchors()->resetFill();
......
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