Skip to content

Commit

Permalink
fix #117486: wrong scrolling of 2nd and subsequent pages when playing…
Browse files Browse the repository at this point in the history
… a multi-page score with vertical page layout
  • Loading branch information
lasconic committed Jul 21, 2017
1 parent 2c3df1b commit 7bfa18c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4247,14 +4247,18 @@ void ScoreView::adjustCanvasPosition(const Element* el, bool playBack)

// align to page borders if extends beyond
Page* page = sys->page();
if (x < page->x() || r.width() >= page->width())
x = page->x();
else if (r.width() < page->width() && r.width() + x > page->width() + page->x())
x = (page->width() + page->x()) - r.width();
if (y < page->y() || r.height() >= page->height())
y = page->y();
else if (r.height() < page->height() && r.height() + y > page->height())
y = (page->height() + page->y()) - r.height();
if (!MScore::verticalOrientation()) {
if (x < page->x() || r.width() >= page->width())
x = page->x();
else if (r.width() < page->width() && r.width() + x > page->width() + page->x())
x = (page->width() + page->x()) - r.width();
}
else {
if (y < page->y() || r.height() >= page->height())
y = page->y();
else if (r.height() < page->height() && r.height() + y > page->height() + page->y())

This comment has been minimized.

Copy link
@MarcSabatella

MarcSabatella Apr 14, 2018

Contributor

To the extent I understand what is going on here, I believe that adding page->y() here is the real fix to the original problem. It seems the refactoring according to verticalOrientation was just meant as an optimization of some sort, to prevent unnecessary changes vertically in horizontal stacking mode or horizontally in vertical stacking mode? Unfortunately, this is also causing https://musescore.org/en/node/271187. The code just above here is noticing the right edge of the measure off the right edge of screen and trying to fix this by putting left edge up to the left edge of the screen, then depending on the code here to avoid the empty space. While we could revisit the decision to move so far left in the first place, there's a decent chance other cases will arise where the original calculation creates unnecessary empty space to the right, and this code here is needed to prevent that.

On the other hand, I can easily believe there were probably some other nice side effects of the refactoring here. So I am not quite ready to propose reverting this change. But anyhow, I'm working on addressing a bunch of "score jumping" issues, and this is one of them.

y = (page->height() + page->y()) - r.height();
}

// hack: don't update if we haven't changed the offset
if (oldX == x && oldY == y)
Expand Down

0 comments on commit 7bfa18c

Please sign in to comment.