mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-16 19:54:13 +02:00
Fix bugtracker #312: wire text rotation not preserved on reload
RotateTextsCommand::undo()/redo() called cti->forceMovedByUser(...) instead of cti->forceRotateByUser(...) for ConductorTextItem entries - a copy-paste mix-up between the two parallel user-override flags that track independently whether a conductor's text was manually moved vs manually rotated. Because rotate_by_user_ was never actually set to true, the rotation attribute-writing gate in Conductor::toXml() (which checks wasRotatedByUser()) never fired, so a manual rotation applied via "Orienter les textes" (Edit > Orienter les textes / Ctrl+Space) was silently dropped on save: the rotation displayed correctly until the project was closed and reopened, at which point it reverted to default orientation. Fix swaps both calls to forceRotateByUser(...), matching what the constructor reads via wasRotatedByUser() when building m_cond_texts. Verified: clean rebuild (506/506, no new warnings). Live-verified under Xvfb that RotateTextsCommand's rotation correctly animates and applies to ConductorTextItem text (confirmed via the "Orienter les textes" dialog). A full save/close/reopen round-trip on a from-scratch two-element wire was attempted but not completed due to unreliable terminal-to-terminal wire drawing via synthetic mouse events in the window-manager-less Xvfb sandbox; confidence in the fix instead rests on tracing the exact save-gate code path (Conductor::toXml() gates solely on wasRotatedByUser(), which the constructor/undo/redo all already correctly reference elsewhere for the parallel moved-by-user flag).
This commit is contained in:
@@ -89,7 +89,7 @@ void RotateTextsCommand::undo()
|
|||||||
m_anim_group->start();
|
m_anim_group->start();
|
||||||
|
|
||||||
for(ConductorTextItem *cti : m_cond_texts.keys())
|
for(ConductorTextItem *cti : m_cond_texts.keys())
|
||||||
cti->forceMovedByUser(m_cond_texts.value(cti));
|
cti->forceRotateByUser(m_cond_texts.value(cti));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RotateTextsCommand::redo()
|
void RotateTextsCommand::redo()
|
||||||
@@ -101,7 +101,7 @@ void RotateTextsCommand::redo()
|
|||||||
m_anim_group->start();
|
m_anim_group->start();
|
||||||
|
|
||||||
for(ConductorTextItem *cti : m_cond_texts.keys())
|
for(ConductorTextItem *cti : m_cond_texts.keys())
|
||||||
cti->forceMovedByUser(true);
|
cti->forceRotateByUser(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RotateTextsCommand::openDialog()
|
void RotateTextsCommand::openDialog()
|
||||||
|
|||||||
Reference in New Issue
Block a user