Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #308568: bad selection and corruption on delete #6415

Merged
merged 1 commit into from
Sep 1, 2020

Commits on Aug 26, 2020

  1. fix #308568: bad selection and corruption on delete

    Resolves: https://musescore.org/en/node/308568
    
    If you make a range selection "in reverse",
    by selecting a note then extending it to the left
    (whether using Shift+Left or Shift+click),
    you get a bad selection where the endSemgent is in the next measure.
    And in the case of a measure at the end of a system,
    it means the selection includes the header of the next system.
    This glitch has been the case since MuseScore 2 at least,
    but with the reimplementation of measure delete as time delete,
    it actually causes corruption when deleting the select range.
    That is because we are getting the wrong measure
    for the end of the selection, and attempting to do a partial time delete
    (with length of 0) in the next measure.
    
    This change fixes the basic problem with selection, so reverse selection
    no longer causes this bad result.
    This is done by adjusting the initial range to end with
    the *first* segment after the originally-selected CR
    rather than the last.
    I also fix the calculation of the range of measures
    to not be fooled if the endSegment comes after a header -
    this was causing an unnecessary invocation of time delete
    to delete the beginning of that next measure.
    Finally, I also check to be sure we aren't trying to delete zero time,
    since that was where the corruption was coming from.
    MarcSabatella committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    a963bc3 View commit details
    Browse the repository at this point in the history