Skip to content

Commit

Permalink
Fix #275099: panning screen with mouse drops selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jthistle committed Aug 19, 2018
1 parent c27d0e6 commit d057948
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mscore/events.cpp
Expand Up @@ -26,6 +26,7 @@
#include "libmscore/chord.h"
#include "libmscore/shadownote.h"
#include "libmscore/repeatlist.h"
#include "libmscore/select.h"

namespace Ms {

Expand Down Expand Up @@ -248,6 +249,10 @@ void ScoreView::mouseReleaseEvent(QMouseEvent*)
changeState(ViewState::FOTO);
break;
case ViewState::NORMAL:
if (editData.startMove == editData.pos && clickOffElement) {
_score->deselectAll();
_score->update();
}
case ViewState::EDIT:
case ViewState::NOTE_ENTRY:
case ViewState::PLAY:
Expand Down Expand Up @@ -306,6 +311,7 @@ void ScoreView::mousePressEventNormal(QMouseEvent* ev)
_score = e->score();
_score->setUpdateAll();
}
clickOffElement = false;
}
else {
// special case: chacke if measure is selected
Expand All @@ -314,9 +320,10 @@ void ScoreView::mousePressEventNormal(QMouseEvent* ev)
if (m && m->staffLines(staffIdx)->canvasBoundingRect().contains(editData.startMove)) {
_score->select(m, st, staffIdx);
_score->setUpdateAll();
clickOffElement = false;
}
else if (st != SelectType::ADD)
_score->deselectAll();
clickOffElement = true;
}
_score->update();
mscore->endCmd();
Expand Down
2 changes: 2 additions & 0 deletions mscore/scoreview.h
Expand Up @@ -397,6 +397,8 @@ class ScoreView : public QWidget, public MuseScoreView {
void changeState(ViewState);

virtual const QRect geometry() const override { return QWidget::geometry(); }

bool clickOffElement;
};

} // namespace Ms
Expand Down

0 comments on commit d057948

Please sign in to comment.