Skip to content

Commit

Permalink
fix #21448 fix #98826 note input cursor ignores the staff scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Feb 19, 2016
1 parent 1d7f1af commit cdedb21
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,15 +1426,15 @@ void ScoreView::moveCursor()
}
double x = segment->canvasPos().x();
double y = system->staffYpage(staffIdx) + system->page()->pos().y();
double _spatium = score()->spatium();
Staff* staff = _score->staff(staffIdx);
double _spatium = staff->spatium();
x -= qMin(segment->pos().x() - score()->styleD(StyleIdx::barNoteDistance) * _spatium, 0.0);

update(_matrix.mapRect(_cursor->rect()).toRect().adjusted(-1,-1,1,1));

double h;
qreal mag = _spatium / SPATIUM20;
double w = _spatium * 2.0 + score()->scoreFont()->width(SymId::noteheadBlack, mag);
Staff* staff = _score->staff(staffIdx);
StaffType* staffType = staff->staffType();
double lineDist = staffType->lineDistance().val() * _spatium;
int lines = staff->lines();
Expand Down Expand Up @@ -1970,8 +1970,8 @@ void ScoreView::paint(const QRect& r, QPainter& p)
}
SysStaff* ss2 = system2->staff(lastStaff);

double y1 = ss1->y() - 2 * _spatium + y;
double y2 = ss2->y() + ss2->bbox().height() + 2 * _spatium + y;
double y1 = ss1->y() - 2 * score()->staff(staffStart)->spatium() + y;
double y2 = ss2->y() + ss2->bbox().height() + 2 * score()->staff(lastStaff)->spatium() + y;

// drag vertical start line
p.drawLine(QLineF(x2, y1, x2, y2).translated(system2->page()->pos()));
Expand Down Expand Up @@ -2018,8 +2018,8 @@ void ScoreView::paint(const QRect& r, QPainter& p)
y = pt.y();
ss1 = system2->staff(staffStart);
ss2 = system2->staff(lastStaff);
y1 = ss1->y() - 2 * _spatium + y;
y2 = ss2->y() + ss2->bbox().height() + 2 * _spatium + y;
y1 = ss1->y() - 2 * score()->staff(staffStart)->spatium() + y;
y2 = ss2->y() + ss2->bbox().height() + 2 * score()->staff(lastStaff)->spatium() + y;
p.drawLine(QLineF(x1, y1, x2, y1).translated(system2->page()->pos()));
p.drawLine(QLineF(x1, y2, x2, y2).translated(system2->page()->pos()));
s = ns;
Expand Down

0 comments on commit cdedb21

Please sign in to comment.