{"action":"created","issue":{"url":"https://api.github.com/repos/musescore/MuseScore/issues/3105","repository_url":"https://api.github.com/repos/musescore/MuseScore","labels_url":"https://api.github.com/repos/musescore/MuseScore/issues/3105/labels{/name}","comments_url":"https://api.github.com/repos/musescore/MuseScore/issues/3105/comments","events_url":"https://api.github.com/repos/musescore/MuseScore/issues/3105/events","html_url":"https://github.com/musescore/MuseScore/pull/3105","id":216748350,"number":3105,"title":"fix #183846 split irreg-len meas shouldn't add padding rests, which cause corruption","user":{"login":"ericfont","id":6502474,"avatar_url":"https://avatars1.githubusercontent.com/u/6502474?v=3","gravatar_id":"","url":"https://api.github.com/users/ericfont","html_url":"https://github.com/ericfont","followers_url":"https://api.github.com/users/ericfont/followers","following_url":"https://api.github.com/users/ericfont/following{/other_user}","gists_url":"https://api.github.com/users/ericfont/gists{/gist_id}","starred_url":"https://api.github.com/users/ericfont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericfont/subscriptions","organizations_url":"https://api.github.com/users/ericfont/orgs","repos_url":"https://api.github.com/users/ericfont/repos","events_url":"https://api.github.com/users/ericfont/events{/privacy}","received_events_url":"https://api.github.com/users/ericfont/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-24T11:08:14Z","updated_at":"2017-03-24T15:26:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/musescore/MuseScore/pulls/3105","html_url":"https://github.com/musescore/MuseScore/pull/3105","diff_url":"https://github.com/musescore/MuseScore/pull/3105.diff","patch_url":"https://github.com/musescore/MuseScore/pull/3105.patch"},"body":"This fixes an bug which produced corrupted measures when splitting irregular length measures.  In Score::cmdSplitMeasure() after the newly split measures are first created, if their new actual length was greater than their nominal length, then Measure::adjustToLen() would append additional padding rests at the end of the measure.  However, the subsequent range.write() assumed that the measures were entirely empty before copying contents from the original measure into the new measures.  The extra padding rests were unnecessary, and caused the resulting measures to contain too many notes than their actual length, hence the corruption.\r\n\r\nThe fix here is to add a default boolean parameter to adjustToLen() called appendRestsIfNecessary which is true by default so as to not change behavior when it is called without specifiying the parameter. However, cmdSplitMeasure() will call adjustToLen with that boolean explicitly false, so that the new measures don't get unnecessary rests."},"comment":{"url":"https://api.github.com/repos/musescore/MuseScore/issues/comments/289054814","html_url":"https://github.com/musescore/MuseScore/pull/3105#issuecomment-289054814","issue_url":"https://api.github.com/repos/musescore/MuseScore/issues/3105","id":289054814,"user":{"login":"lasconic","id":234271,"avatar_url":"https://avatars3.githubusercontent.com/u/234271?v=3","gravatar_id":"","url":"https://api.github.com/users/lasconic","html_url":"https://github.com/lasconic","followers_url":"https://api.github.com/users/lasconic/followers","following_url":"https://api.github.com/users/lasconic/following{/other_user}","gists_url":"https://api.github.com/users/lasconic/gists{/gist_id}","starred_url":"https://api.github.com/users/lasconic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasconic/subscriptions","organizations_url":"https://api.github.com/users/lasconic/orgs","repos_url":"https://api.github.com/users/lasconic/repos","events_url":"https://api.github.com/users/lasconic/events{/privacy}","received_events_url":"https://api.github.com/users/lasconic/received_events","type":"User","site_admin":false},"created_at":"2017-03-24T15:26:38Z","updated_at":"2017-03-24T15:26:38Z","body":"It looks good and it works ok, tested."}}
{"actor":{"display_login":"lasconic"}}