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

Fix drawing bug in bounding rect for form editor items

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