Skip to content

Commit

Permalink
Fix #307623: Y offsets change when stave space is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch committed Jul 9, 2020
1 parent 1f310c1 commit b2b2e6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
3 changes: 3 additions & 0 deletions libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,9 @@ void ChangeStyleVal::flip(EditData*)
score->style().chordList()->read(score->styleSt(Sid::chordDescriptionFile));
}
break;
case Sid::spatium:
score->spatiumChanged(v.toDouble(), value.toDouble());
break;
default:
break;
}
Expand Down
8 changes: 1 addition & 7 deletions mscore/pagesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,7 @@ void PageSettings::applyToScore(Score* s)
s->undoChangeStyleVal(Sid::pageOddBottomMargin, oddPageBottomMargin->value() * f);
s->undoChangeStyleVal(Sid::pageOddLeftMargin, oddPageLeftMargin->value() * f);
s->undoChangeStyleVal(Sid::pageTwosided, twosided->isChecked());

qreal oldSpatium = s->spatium();
qreal newSpatium = spatiumEntry->value() * f1;
s->undoChangeStyleVal(Sid::spatium, newSpatium);
if (oldSpatium != newSpatium)
s->spatiumChanged(oldSpatium, newSpatium);

s->undoChangeStyleVal(Sid::spatium, spatiumEntry->value() * f1);
s->undoChangePageNumberOffset(pageOffsetEntry->value() - 1);
}

Expand Down
17 changes: 1 addition & 16 deletions mscore/plugin/api/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,7 @@ void MStyle::setValue(const QString& key, QVariant value) {
value = QVariant::fromValue(Ms::Spatium(value.toReal()));

if (_score) {
// Style belongs to actual score: change style value in undoable way
switch (sid) {
case Sid::spatium: {
const qreal oldSpatium = _score->spatium();
const qreal newSpatium = value.toReal();

if (newSpatium > 0.0 && oldSpatium != newSpatium) {
_score->undoChangeStyleVal(Sid::spatium, newSpatium);
_score->spatiumChanged(oldSpatium, newSpatium);
}
}
break;
default:
_score->undoChangeStyleVal(sid, value);
break;
}
_score->undoChangeStyleVal(sid, value);
}
else {
// Style is not bound to a score: change the value directly
Expand Down

0 comments on commit b2b2e6f

Please sign in to comment.