diff --git a/libmscore/bend.cpp b/libmscore/bend.cpp index c193751f7e..6cc38aed26 100644 --- a/libmscore/bend.cpp +++ b/libmscore/bend.cpp @@ -76,14 +76,13 @@ void Bend::layout() qreal _spatium = spatium(); if (staff() && !staff()->isTabStaff(tick())) { - setbbox(QRectF()); if (!parent()) { noteWidth = -_spatium*2; notePos = QPointF(0.0, _spatium*3); } } - qreal _lw = _lineWidth.val() * _spatium; + qreal _lw = _lineWidth; Note* note = toNote(parent()); if (note == 0) { noteWidth = 0.0; @@ -95,7 +94,7 @@ void Bend::layout() } QRectF bb; - QFontMetricsF fm(font(_spatium)); + QFontMetricsF fm(font(_spatium), MScore::paintDevice()); int n = _points.size(); qreal x = noteWidth; @@ -143,7 +142,6 @@ void Bend::layout() path.moveTo(x, y); path.cubicTo(x+dx/2, y, x2, y+dy/4, x2, y2); bb |= path.boundingRect(); - bb |= arrowUp.translated(x2, y2 + _spatium * .2).boundingRect(); int idx = (_points[pt+1].pitch + 12)/25; @@ -181,7 +179,7 @@ void Bend::layout() void Bend::draw(QPainter* painter) const { qreal _spatium = spatium(); - qreal _lw = _lineWidth.val(); + qreal _lw = _lineWidth; QPen pen(curColor(), _lw, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); painter->setPen(pen); @@ -189,7 +187,7 @@ void Bend::draw(QPainter* painter) const QFont f = font(_spatium * MScore::pixelRatio); painter->setFont(f); - QFontMetrics fm(f); + QFontMetrics fm(f, MScore::paintDevice()); qreal x = noteWidth + _spatium * .2; qreal y = -_spatium * .8; @@ -356,7 +354,7 @@ bool Bend::setProperty(Pid id, const QVariant& v) setPlayBend(v.toBool()); break; case Pid::LINE_WIDTH: - _lineWidth = v.value(); + _lineWidth = v.toReal(); break; default: return Element::setProperty(id, v); diff --git a/libmscore/bend.h b/libmscore/bend.h index 52f395b3bc..2e25ba524a 100644 --- a/libmscore/bend.h +++ b/libmscore/bend.h @@ -28,7 +28,7 @@ class Bend final : public Element { M_PROPERTY(QString, fontFace, setFontFace) M_PROPERTY(qreal, fontSize, setFontSize) M_PROPERTY(FontStyle, fontStyle, setFontStyle) - M_PROPERTY(Spatium, lineWidth, setLineWidth) + M_PROPERTY(qreal, lineWidth, setLineWidth) bool _playBend { true }; QList _points; diff --git a/libmscore/score.cpp b/libmscore/score.cpp index 3f78a49f51..ea51bab56d 100644 --- a/libmscore/score.cpp +++ b/libmscore/score.cpp @@ -4487,14 +4487,14 @@ Movements::~Movements() //--------------------------------------------------------- // ScoreLoad::_loading -// If the _loading flag is set pushes and pops to +// If the _loading > 0 then pushes and pops to // the undo stack do not emit a warning. // Usually pushes and pops to the undo stack are only // valid inside a startCmd() - endCmd(). Exceptions // occure during score loading. //--------------------------------------------------------- -bool ScoreLoad::_loading = false; +int ScoreLoad::_loading = 0; } diff --git a/libmscore/score.h b/libmscore/score.h index 19d3c535a0..502cd935b2 100644 --- a/libmscore/score.h +++ b/libmscore/score.h @@ -1304,7 +1304,7 @@ class MasterScore : public Score { void enqueueMidiEvent(MidiInputEvent ev) { _midiInputQueue.enqueue(ev); } void updateChannel(); void setSoloMute(); - + void addExcerpt(Excerpt*); void removeExcerpt(Excerpt*); void deleteExcerpt(Excerpt*); @@ -1331,12 +1331,12 @@ class MasterScore : public Score { //--------------------------------------------------------- class ScoreLoad { - static bool _loading; + static int _loading; public: - ScoreLoad() { _loading = true; } - ~ScoreLoad() { _loading = false; } - static bool loading() { return _loading; } + ScoreLoad() { ++_loading; } + ~ScoreLoad() { --_loading; } + static bool loading() { return _loading > 0; } }; inline UndoStack* Score::undoStack() const { return _masterScore->undoStack(); }