Skip to content
Snippets Groups Projects
Commit 6ba64351 authored by Olivier Goffart's avatar Olivier Goffart
Browse files

qmlobserver: workaround crash if an item has an infinite scale

infinite scale may occours if the qml scale binding sets an infinite scale.
parent 72698530
No related branches found
No related tags found
No related merge requests found
...@@ -78,8 +78,11 @@ void SelectionIndicator::clear() ...@@ -78,8 +78,11 @@ void SelectionIndicator::clear()
QPolygonF SelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPolygonF &polygon) QPolygonF SelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPolygonF &polygon)
{ {
// ### remove this if statement when QTBUG-12172 gets fixed // ### remove this if statement when QTBUG-12172 gets fixed
if (item->boundingRect() != QRectF(0,0,0,0)) if (item->boundingRect() != QRectF(0,0,0,0)) {
polygon = polygon.united(item->mapToScene(item->boundingRect())); QPolygonF bounding = item->mapToScene(item->boundingRect());
if (bounding.isClosed()) //avoid crashes if there is an infinite scale.
polygon = polygon.united(bounding);
}
foreach(QGraphicsItem *child, item->childItems()) { foreach(QGraphicsItem *child, item->childItems()) {
if (!QDeclarativeDesignViewPrivate::get(m_view)->isEditorItem(child)) if (!QDeclarativeDesignViewPrivate::get(m_view)->isEditorItem(child))
......
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