Fix: "group rotate" of elements detached the conductors as those were not rotated.

This commit is contained in:
Andre Rummler
2026-09-18 12:35:08 +02:00
parent 0258d1a74f
commit 54e61d482d
+18 -3
View File
@@ -135,14 +135,29 @@ Element::Element(
| QGraphicsItem::ItemIsSelectable);
setAcceptHoverEvents(true);
connect(this, &Element::rotationChanged, [this]()
{
/* Keep docked conductors attached whenever this element's
* rotation OR scene position changes. Ordinary single-item
* dragging already refreshes conductors explicitly, via
* ElementsMover::continueMovement() calling
* Conductor::updatePath(). But other code paths change an
* element's rotation/pos properties directly -- notably
* RotateSelectionCommand's group-rotation mode, which moves
* each element around a shared pivot via a "pos"
* QPropertyUndoCommand instead of going through
* ElementsMover -- and those need this hook or the
* conductor's path is left stale, still drawn to the
* terminal's old scene position. */
auto update_docked_conductors = [this]()
{
for(QGraphicsItem *qgi : childItems())
{
if (Terminal *t = qgraphicsitem_cast<Terminal *>(qgi))
t->updateConductor();
}
});
};
connect(this, &Element::rotationChanged, update_docked_conductors);
connect(this, &Element::xChanged, update_docked_conductors);
connect(this, &Element::yChanged, update_docked_conductors);
}
/**