[trunk] Crash when changing triplet duration after insertion
R5253, Windows XP.
Open the enclosed score. Add more triplets so it looks like this:
.
Then try to change the second (original) 1/8 triplet (the one in the middle) to a 1/16. Bang!
Attachment | Size |
---|---|
tt5.png | 9.06 KB |
bug 2.mscx | 26.23 KB |
Comments
Confirmed - thanks.
It happens if you click any value lower than a quaver.
Using MuseScore 2.0 Nightly Build (5259) - Mac 10.6.8.
I'd like to get the ball rolling on this.
The enclosed patch fixes the crash.
With this change, the note is correctly changed, a rest inserted and the following note is drawn with the correct hook.
NOT FOUND: 02
Sadly, upon undo it falls apart and doesn't draw correctly any more:
NOT FOUND: 03
Further analysis:
The problem after undo has to do with the fact that the beam isn't drawn correctly. In beam.cpp:1153 it tries to extend the stem to the beam, but since there is no beam, it draws the stem to Y=+/- 1000000. Here is the code:
qreal y = chordUp ? 1000000.0 : -1000000;
// extend stem to farest beam segment
qreal x = x2 - parent()->pagePos().x();
foreach(QLineF* l, beamSegments) {
if ((l->x1() <= x) && (l->x2() > x)) {
qreal dx = x - l->x1();
If the loop is empty, like in this case, so no beams, then the inital y value of +/- 1000000 is used.
Please let me know what you think.
It reminds me of these:
#11777: Deleting beamed acciaccatura and undo causes infinite stem
#11782: [Trunk] Adding quarter grace note to note with existing set of beamed grace notes causes infinite stems
I had something similar just now. I had tried to create a triplet (wanted it to replace a quarter note, but it
was set to replaced an eighth). I couldn't figure out how to delete the eighth triplet, so I ended up deleting the measure to rewrite it. In the blank measure, I set note to quarter, then pressed Ctrl-3 and it crashed. (see attached)
DougEdmunds, could you upload the file again?
Chen Lung: I had to use Task Manager to kill the process when it crashed; the application wouldn't close normally. But it reopened fine without a reboot, and it opened with the work file intact. I have not had the crash again (but I'm not doing much else right now with triplets either).
Machine: Win7 x64
MuseScore 1.1 Rev 4611
I was talking about the PNG :).
It's a screenshot of the error message. I'll try again.
Thanks :).
revised patch (nicer comment), also contains fix to http://musescore.org/en/node/10577.
Next I will investigate the missing beam and the endless stem.
- the hook is created in layoutStem1(), layoutStem() should not create a hook. The bug is that layoutStem() should only layout a hook if there is one
- undo did not work bc. the chords/rests in beam->_elements have to be sorted by tick. Fix is to change Beam->add() to ensure this.
fixed in r5272
Automatically closed -- issue fixed for 2 weeks with no activity.