Properly update parent item's bounding rect when moving item

The bounding rect of an item is in the item-local coordinate space. If
the item is moved, its bounding rect won't change, but the parent's
bounding rect, may change.

BUG: 443756
This commit is contained in:
Vlad Zahorodnii 2021-10-15 10:29:35 +03:00
parent ff3465a80e
commit 59a4a908f9

View file

@ -106,7 +106,9 @@ void Item::setPosition(const QPoint &point)
if (m_position != point) {
scheduleRepaint(boundingRect());
m_position = point;
updateBoundingRect();
if (m_parentItem) {
m_parentItem->updateBoundingRect();
}
scheduleRepaint(boundingRect());
Q_EMIT positionChanged();
}