Skip to content

Commit

Permalink
Merge pull request #5156 from mattmcclinch/289254-change-state
Browse files Browse the repository at this point in the history
fix #289254: Beam in edit mode always switches to right grab handle
  • Loading branch information
dmitrio95 committed Nov 18, 2019
2 parents 34d7d32 + 4c5e745 commit 74d17fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion libmscore/beam.cpp
Expand Up @@ -2140,8 +2140,10 @@ void Beam::editDrag(EditData& ed)
y1 += dy;

qreal _spatium = spatium();
undoChangeProperty(Pid::BEAM_POS, QPointF(y1 / _spatium, y2 / _spatium));
// Because of the logic in Beam::setProperty(),
// changing Pid::BEAM_POS only has an effect if Pid::USER_MODIFIED is true.
undoChangeProperty(Pid::USER_MODIFIED, true);
undoChangeProperty(Pid::BEAM_POS, QPointF(y1 / _spatium, y2 / _spatium));
undoChangeProperty(Pid::GENERATED, false);

triggerLayout();
Expand Down
2 changes: 1 addition & 1 deletion mscore/editelement.cpp
Expand Up @@ -111,7 +111,7 @@ void ScoreView::startEdit(Element* element, Grip startGrip)
editData.element = element;
if (forceStartEdit) // call startEdit() forcibly to reinitialize edit mode.
startEdit();
else
else if (state != ViewState::DRAG_EDIT)
changeState(ViewState::EDIT);

if (startGrip != Grip::NO_GRIP)
Expand Down
3 changes: 1 addition & 2 deletions mscore/events.cpp
Expand Up @@ -1036,9 +1036,8 @@ void ScoreView::changeState(ViewState s)
startEdit();
break;
case ViewState::EDIT:
if ( !((mscoreState() & STATE_ALLTEXTUAL_EDIT) && state == ViewState::DRAG_EDIT) ) {
if (state != ViewState::DRAG_EDIT)
startEdit();
}
break;
case ViewState::LASSO:
break;
Expand Down

0 comments on commit 74d17fc

Please sign in to comment.