Better handling of conductors when moving

For conductors, the setPos() function can result in negative
coordinates.
For unknown reasons, this can lead to an offset in the scene coordinate
system, resulting in a free space above and to the left of the drawing
frame. This free space could not be removed.

It is better to set the conductors using the conductor::updatePath()
function. If the conductor text has been moved by the user, the new
position of the text must be calculated.
It is important to position the elements first and then 'connect' the
conductors.
Setting the conductor position via setPos() was done in elemntsmover.cpp
(corrected here) and in Diagram::fromXML (corrected in the commit
'Better handling of conductors when creating from XML').
This commit is contained in:
achim
2025-08-11 23:13:46 +02:00
parent 0f179a5d49
commit 29c362fe4c
3 changed files with 44 additions and 30 deletions

View File

@@ -49,6 +49,7 @@ class MoveGraphicsItemCommand : public QUndoCommand
private:
void move(const QPointF &movement);
void updateConductors(bool is_redo = false);
void setupAnimation(QObject *target,
const QByteArray &property_name,
const QVariant &start,