musescore/MuseScore — pull request #1415 by MarcSabatella (2014-10-29 05:07:27+00:00)
Title: fix #32866: score jumping issues

There are a bunch of related issues I am trying to fix together. The fixes are related enough that I think it best to make and test them together, but I will annotate the changes in the commentsto show which issue is actually fixed by which change.

The underlying problem here is that adjustCanvasPosition is called too often and/or with too broad a target. This is in part because Score objects emit posChanged signals any time you click a note:

https://github.com/musescore/MuseScore/blob/396c44f97d090d7fcfbcc8f1e40506e7c5647c28/libmscore/score.cpp#L3431

This causes all scoreviews to respond, when really, only the current scoreview usually needs to. Furthermore, there is not enough of the original context (eg, which note was clicked to trigger this) to be able to position the score well. I guess there isn't a more focused call to adjustCanvasPosition in order to maintain the separation between libmscore and mscore. Or may it is intended that in some cases, all scoreviews *should* respond. In any case, I elected to leave this alone, and instead deal with the problems on the scoreview side.

There are also other places where adjustCanvasPosition is called unnecessarily, or with to broad a target.