Commit a1ea676c authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Fix margins for Group Box

We used the item size for calculation, now we use the content item
bounding rectangle.

Change-Id: I94ca0565c1c3d992563207ee1cd9c1dcb8c874ea
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 84e21c76
......@@ -619,14 +619,19 @@ static void adjustAnchorLine(const QmlItemNode &sourceQmlItemNode,
if (targetQmlItemNode.isValid() && !targetQmlItemNode.anchors().checkForCycle(lineAnchorLineType, sourceQmlItemNode)) {
double margin = 0.0;
QRectF boundingRect = targetQmlItemNode.instanceContentItemBoundingRect();
if (boundingRect.isNull())
boundingRect = targetQmlItemNode.instanceBoundingRect();
if (targetQmlItemNode == containerQmlItemNode) {
if (lineAnchorLineType == AnchorLine::Left
|| lineAnchorLineType == AnchorLine::Top)
margin = fromAnchorLine;
if (lineAnchorLineType == AnchorLine::Left)
margin = fromAnchorLine - boundingRect.left();
else if (lineAnchorLineType == AnchorLine::Top)
margin = fromAnchorLine - boundingRect.top();
else if (lineAnchorLineType == AnchorLine::Right)
margin = targetQmlItemNode.instanceSize().width() - fromAnchorLine;
margin = boundingRect.right() - fromAnchorLine;
else if (lineAnchorLineType == AnchorLine::Bottom)
margin = targetQmlItemNode.instanceSize().height() - fromAnchorLine;
margin = boundingRect.bottom() - fromAnchorLine;
}
......
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