Skip to content

Commit

Permalink
Merge pull request #3200 from MarcSabatella/197101-adjust-canvas-more
Browse files Browse the repository at this point in the history
fix #197101: ctrl+home should reposition canvas
  • Loading branch information
lasconic committed Jun 12, 2017
2 parents 24ee3a2 + 93127b1 commit 3a6db25
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,21 @@ void ScoreView::adjustCanvasPosition(const Element* el, bool playBack)
m = static_cast<const Segment*>(el->parent()->parent())->measure();
else if (el->type() == ElementType::MEASURE || el->type() == ElementType::VBOX)
m = static_cast<const MeasureBase*>(el);
else
else if (el->isSpannerSegment())
m = static_cast<const SpannerSegment*>(el)->spanner()->startMeasure();
else if (el->isSpanner())
m = static_cast<const Spanner*>(el)->startMeasure();
else {
// attempt to find measure
Element* e = el->parent();
while (e && e->type() != ElementType::MEASURE)
e = e->parent();
if (e)
m = static_cast<Measure*>(e);
else
return;
}
if (!m)
return;

int staffIdx = el->staffIdx();
Expand Down

0 comments on commit 3a6db25

Please sign in to comment.