Skip to content
Snippets Groups Projects
Commit fd2e00f6 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Fix crash in anchor update function


Task-number: QTCREATORBUG-11138
Change-Id: Ie7eeb1cf93d96f377f53cb69587285c8da7988a7
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent f97df3e9
No related branches found
No related tags found
No related merge requests found
......@@ -211,24 +211,26 @@ static void updateAnchorLinePoints(QPointF *firstPoint, QPointF *secondPoint, co
void AnchorIndicatorGraphicsItem::updateAnchorIndicator(const AnchorLine &sourceAnchorLine, const AnchorLine targetAnchorLine)
{
m_sourceAnchorLineType = sourceAnchorLine.type();
m_targetAnchorLineType = targetAnchorLine.type();
if (sourceAnchorLine.qmlItemNode().isValid() && targetAnchorLine.qmlItemNode().isValid()) {
m_sourceAnchorLineType = sourceAnchorLine.type();
m_targetAnchorLineType = targetAnchorLine.type();
m_startPoint = createAnchorPoint(sourceAnchorLine.qmlItemNode(), sourceAnchorLine.type());
m_startPoint = createAnchorPoint(sourceAnchorLine.qmlItemNode(), sourceAnchorLine.type());
if (targetAnchorLine.qmlItemNode() == sourceAnchorLine.qmlItemNode().instanceParentItem())
m_endPoint = createParentAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type(), sourceAnchorLine.qmlItemNode());
else
m_endPoint = createAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type());
if (targetAnchorLine.qmlItemNode() == sourceAnchorLine.qmlItemNode().instanceParentItem())
m_endPoint = createParentAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type(), sourceAnchorLine.qmlItemNode());
else
m_endPoint = createAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type());
m_firstControlPoint = createControlPoint(m_startPoint, sourceAnchorLine.type(), m_endPoint);
m_secondControlPoint = createControlPoint(m_endPoint, targetAnchorLine.type(), m_startPoint);
m_firstControlPoint = createControlPoint(m_startPoint, sourceAnchorLine.type(), m_endPoint);
m_secondControlPoint = createControlPoint(m_endPoint, targetAnchorLine.type(), m_startPoint);
updateAnchorLinePoints(&m_sourceAnchorLineFirstPoint, &m_sourceAnchorLineSecondPoint, sourceAnchorLine);
updateAnchorLinePoints(&m_targetAnchorLineFirstPoint, &m_targetAnchorLineSecondPoint, targetAnchorLine);
updateAnchorLinePoints(&m_sourceAnchorLineFirstPoint, &m_sourceAnchorLineSecondPoint, sourceAnchorLine);
updateAnchorLinePoints(&m_targetAnchorLineFirstPoint, &m_targetAnchorLineSecondPoint, targetAnchorLine);
updateBoundingRect();
update();
updateBoundingRect();
update();
}
}
void AnchorIndicatorGraphicsItem::updateBoundingRect()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment