musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.29k stars 2.66k forks source link

Undoing and re-adding certain objects causes extra ones added (Clefs, Time signatures, Key signatures, Barlines, Repeats, Layout) #17718

Closed LupusCaeruleus closed 1 month ago

LupusCaeruleus commented 1 year ago

Issue type

Other type of issue

Bug description

Update: Also affects Clefs, Time sigs and Key sigs.

This bug seems to occur only on some objects of the panels Barlines, Repeats & Jumps and Layout.

When certain objects from the 3 panels are added then undo-ed, re-adding them will add one extra object to the next bar. See Steps to reproduce and Screen recording for more details.

Steps to reproduce

  1. Select a bar (or a range of bars) on the staff.
  2. Add any of the following objects below, by clicking them in their panels.  Repeats & Jumps Panel: Segno symbols, Coda symbols, Texts, Repeat signs.  Barlines Panel: Barlines.  Layout Panel: Stave spacers, Frames, Insert one bar before selection.
  3. Press Ctrl+Z (or use other methods) to undo.
  4. Repeat step 2.
  5. One extra object is added to the next bar.

Expected behaviour: No extra objects should be added.

Screenshots/Screen recordings

https://github.com/musescore/MuseScore/assets/70313425/c1ed39bc-2ae0-40e4-9ddf-a96e43d90bae

https://github.com/musescore/MuseScore/assets/70313425/3e016377-01aa-4d40-87fc-07166424a24e

MuseScore Version

4.0.2

Regression

Yes, this used to work in MuseScore 3.x and now is broken

Operating system

Windows 10

Additional context

I noticed that after adding and undoing, the blue range selection box extends a little bit to the right and seems to enclose the barline on the right. Maybe this is the issue?

Normal selection: image

After adding and undoing: image

zacjansheski commented 1 year ago

Possible duplicate https://github.com/musescore/MuseScore/issues/15851