Undo of virtually any note operation destroys layout
Windows 7, GIT commit: b00e0e5
1) create score
2) add a note
3) undo
Result: all measures become way too short, fitting way too many measures per system, clef for next systems moves onto this system, etc.
Seems to be pretty much any operation on a note, any score. If there are no line breaks holding things together, Undo destroys the layout.
Attachment | Size |
---|---|
undo-mess.png | 4.22 KB |
Comments
This is just a visual problem. If you switch to continuous view mode, then back to normal view, all gets back to correct display.
Should be easy to fix.
And the problem doesn't happen in continuous view.
Good to know! Yes, even a Ctrl+A fixes it. Sure *looks* scary though :-)
If I had to hazard a guess, I'd say the issue has to do with the commenting out of this chunk of code:
https://github.com/musescore/MuseScore/blob/fb0e15eb1084fa62b6fef28b6b5…
No, can't be there, because bool Score::layoutSystem isn't even called after we pressed undo. But Scrore::layoutSystem is called after we pressed Ctrl+A. So the problem is that Score::layoutSystem should be called after the undo.
If we comment out the lines 1922 and 1923 of layout.cpp, the problem disappear.
if (undoRedo()) // no change possible in this state
return layoutSystem1(minWidth, isFirstSystem, longName);
layoutSystem1 is a function very similar to layoutSystem
So it seems like layoutSystem1 contains a problem that isn't present in layoutSystem.
I think we should have only one function for the layout instead of two similar ones. Maybe adding an "if" condition in layoutSystem if something related to undoRedo() shouldn't be done.
Fixed in 1cd4416c82
Automatically closed -- issue fixed for 2 weeks with no activity.