Skip to content

Commit

Permalink
fix #117236: honor 'pan score' button during edits
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella authored and lasconic committed Apr 30, 2018
1 parent 6ea0b0e commit 2f80f5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2763,6 +2763,9 @@ void ScoreView::adjustCanvasPosition(const Element* el, bool playBack, int staff
{
if (this != mscore->currentScoreView())
return;
// TODO: change icon, or add panning options
if (!mscore->panDuringPlayback())
return;

if (score()->layoutMode() == LayoutMode::LINE) {

Expand Down Expand Up @@ -2797,6 +2800,13 @@ void ScoreView::adjustCanvasPosition(const Element* el, bool playBack, int staff
if (_continuousPanel->active())
marginLeft += _continuousPanel->width() * mag();

// this code implements "continuous" panning
// it could potentially be enabled via more panning options
//if (playBack && _cursor) {
// // keep playback cursor pinned at 25%
// xo = -curPosL * mag() + marginLeft + width() * 0.2;
// }
//else
if (round(curPosMagR) > round(width() - marginRight)) {
// focus in or beyond right margin
// pan to left margin in playback,
Expand Down
2 changes: 1 addition & 1 deletion mscore/shortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ Shortcut Shortcut::_sc[] = {
"pan",
QT_TRANSLATE_NOOP("action","Pan Score"),
QT_TRANSLATE_NOOP("action","Toggle 'Pan Score'"),
QT_TRANSLATE_NOOP("action","Pan score during playback"),
QT_TRANSLATE_NOOP("action","Pan score automatically"),
Icons::pan_ICON,
Qt::WindowShortcut,
ShortcutFlags::A_SCORE | ShortcutFlags::A_CHECKABLE | ShortcutFlags::A_CHECKED
Expand Down

0 comments on commit 2f80f5f

Please sign in to comment.