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

Fix drawing bug in bounding rect for form editor items

parent 8e5bcfce
......@@ -61,7 +61,8 @@ FormEditorItem::FormEditorItem(const QmlItemNode &qmlItemNode, FormEditorScene*
m_snappingLineCreator(this),
m_qmlItemNode(qmlItemNode),
m_borderWidth(1.0),
m_opacity(0.6)
m_opacity(0.6),
m_highlightBoundingRect(false)
{
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
setup();
......@@ -210,10 +211,17 @@ void FormEditorItem::paintBoundingRect(QPainter *painter) const
}
break;
case FormEditorScene::NormalMode: {
if (m_highlightBoundingRect)
pen.setColor("#AAAAAA");
else
pen.setColor("#888888");
if (scene()->showBoundingRects()) {
if (m_highlightBoundingRect)
pen.setColor("#AAAAAA");
else
pen.setColor("#888888");
} else {
if (m_highlightBoundingRect)
pen.setColor("#AAAAAA");
else
pen.setColor(Qt::transparent);
}
}
break;
}
......@@ -243,8 +251,7 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
painter->setRenderHint(QPainter::Antialiasing, false);
if (scene()->showBoundingRects() || m_highlightBoundingRect)
paintBoundingRect(painter);
paintBoundingRect(painter);
painter->restore();
}
......
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