Skip to content

Commit

Permalink
fix regression for linear view
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Nov 16, 2015
1 parent d8e4373 commit 149ea93
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mscore/continuouspanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ void ContinuousPanel::paint(const QRect& /*r*/, QPainter& p)
//
// Check elements at current panel position
//
_offsetPanel = -(_sv->xoffset()) / _sv->mag();
_offsetPanel = -(_sv->xoffset()) / _sv->pmag();
_rect = QRect(_offsetPanel + _width, _y, 1, _height);
//qDebug() << "width=" << _width << "_y="<< _y << "_offsetPanel=" << _offsetPanel << "_sv->xoffset()" << _sv->xoffset() << "_sv->mag()" << _sv->mag() <<"_spatium" << _spatium << "s->canvasPos().x()" << s->canvasPos().x() << "s->x()" << s->x();
//qDebug() << "width=" << _width << "_y="<< _y << "_offsetPanel=" << _offsetPanel << "_sv->xoffset()" << _sv->xoffset() << "_sv->pmag()" << _sv->pmag() <<"_spatium" << _spatium << "s->canvasPos().x()" << s->canvasPos().x() << "s->x()" << s->x();
Page* page = _score->pages().front();
QList<Element*> elementsCurrent = page->items(_rect);
if (elementsCurrent.empty()) {
Expand Down Expand Up @@ -155,11 +155,11 @@ void ContinuousPanel::paint(const QRect& /*r*/, QPainter& p)
findElementWidths(elementsCurrent);

// Don't show panel if staff names are visible
if (_sv->xoffset() / _sv->mag() + _xPosMeasure > 0) {
if (_sv->xoffset() / _sv->pmag() + _xPosMeasure > 0) {
_visible = false;
return;
}
//qDebug() << "_sv->xoffset()=" <<_sv->xoffset() << " _sv->mag()="<< _sv->mag() <<" s->x=" << s->x() << " width=" << _width << " currentMeasue=" << _currentMeasure->x() << " _xPosMeasure=" << _xPosMeasure;
//qDebug() << "_sv->xoffset()=" <<_sv->xoffset() << " _sv->pmag()="<< _sv->pmag() <<" s->x=" << s->x() << " width=" << _width << " currentMeasue=" << _currentMeasure->x() << " _xPosMeasure=" << _xPosMeasure;

draw(p, elementsCurrent);
_visible = true;
Expand Down
9 changes: 9 additions & 0 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3735,6 +3735,15 @@ qreal ScoreView::mag() const
return _matrix.m11() / (mscore->physicalDotsPerInch() / DPI);
}

//---------------------------------------------------------
// pmag
//---------------------------------------------------------

qreal ScoreView::pmag() const
{
return _matrix.m11();
}

//---------------------------------------------------------
// setOffset
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions mscore/scoreview.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ class ScoreView : public QWidget, public MuseScoreView {
void setDropAnchor(const QLineF&);
const QTransform& matrix() const { return _matrix; }
qreal mag() const;
qreal pmag() const;
MagIdx magIdx() const { return _magIdx; }
void setMag(MagIdx idx, double mag);
qreal xoffset() const;
Expand Down

0 comments on commit 149ea93

Please sign in to comment.