Adding Title, Composer, and others, in a inserted vertical frame, causes a jump at beginning of the score
MuseScore 2.0 Beta1 / Windows7
Reported firstly on the French forum : http://musescore.org/fr/node/33836
1) Open default score
2) « I » → Select staff 1 → Add staff → Ok
3) Second page → select measure 25 → right-click (so, outside the selection) → Frames → Insert Vertical Frame
4) Select the new frame → right-click → Add -> Title
Result : the score jumps at beginning
Same result with : composer, subtitle, composer, and lyricist. Entering text doesn't causes the same effect
Other example, with a variant (no title at the creation of the score)
1) New score for flute : 4/4, 250 measures
2) Select measure 218 → as in the first example, reproduce the same process and steps.
3) At the end of the step #4, so: Add → Title
Result : an inserted second vertical frame is created « automatically » at the beginning of the score.
You may entering Title in the « first » vertical frame. But by adding Composer, etc., again the score jumps at the beginning.
Comments
For accuracy: same result in the last Nighlty: d9331b6
Little correction about the result for the second example: Result : a second vertical frame is created « automatically » at the beginning of the score.
I'm guessing I broke this fixing #23667: Add / Text / Title et al does not reposition score view to show the text being added, or if not, it is at least related.
If it broke, it was done very quickly, because I see a good behavior on July 5 (Nightly 1ccf85a). But three days later, on July 8 (Nightly f97c0a4), I see this bug again (jump at the beginning) as described today.
My change was merged on July 5. I'm not sure which nightly it might have appeared in.
However, it looks to me like my code is actually *not* the actual source of the problem, although it is what made the problem more visible.
My change was to a function called "cmdAddText()" that I believe is only meant to be called when adding text from the main menu (Add / Text / Title). That's why it jumps to the beginning (once my change was made), and that is why it automatically creates a new frame if there wasn't one there already.
I believe that this function should not be called at all when adding title text via the context (right click) menu. That should be handled by a totally different function, elementPropertyAction(). And in fact, it *is* being handled by that function. So, adding titles via the context menu is actually being handled *twice* - once by cmdAddText(), and once by elementPropertyAction(). cmdAddtext() is why the display is jumping, and that much is the result of my change. But worse, cmdAddText() is also adding an initial frame if one doesn't exist, and it's also adding a empty text element to the initial frame as well as adding the title you are actually trying to add.
The thing is, it kind of looks like this is deliberate - like the context menu code is trying to *force* the command to go through the main menu code as well as through its own code. Not sure why. If no one has any insight, I'll try to change it and hope nothing breaks.
https://github.com/musescore/MuseScore/pull/1336
After further study, I couldn't find any good reason why the actions needed to be handled twice. And my code fixes the issue without breaking anything else that I cam see.
Fixed in 2bab0bbdad
Automatically closed -- issue fixed for 2 weeks with no activity.