diff --git a/src/engraving/dom/rest.cpp b/src/engraving/dom/rest.cpp index 857590782dac..dfced9f76422 100644 --- a/src/engraving/dom/rest.cpp +++ b/src/engraving/dom/rest.cpp @@ -697,6 +697,13 @@ double Rest::rightEdge() const return x() + width(); } +double Rest::centerX() const +{ + SymId sym = layoutData()->sym(); + RectF bbox = symBbox(sym); + return bbox.left() + bbox.width() / 2; +} + //--------------------------------------------------------- // accent //--------------------------------------------------------- diff --git a/src/engraving/dom/rest.h b/src/engraving/dom/rest.h index 06461ef41af9..39fb968349e8 100644 --- a/src/engraving/dom/rest.h +++ b/src/engraving/dom/rest.h @@ -115,6 +115,7 @@ class Rest : public ChordRest double stemPosX() const override; mu::PointF stemPosBeam() const override; double rightEdge() const override; + double centerX() const; void localSpatiumChanged(double oldValue, double newValue) override; PropertyValue propertyDefault(Pid) const override; diff --git a/src/engraving/rendering/dev/tlayout.cpp b/src/engraving/rendering/dev/tlayout.cpp index 2ca30f83c199..19d5033277f9 100644 --- a/src/engraving/rendering/dev/tlayout.cpp +++ b/src/engraving/rendering/dev/tlayout.cpp @@ -1933,6 +1933,10 @@ void TLayout::layout(const Fermata* item, Fermata::LayoutData* ldata, const Layo const Chord* chord = toChord(e); x = chord->x() + chord->centerX(); y = chord->y(); + } else if (e->isRest()) { + const Rest* rest = toRest(e); + x = rest->x() + rest->centerX(); + y = rest->y(); } else { x = e->x() - e->shape().left() + e->width() * item->staff()->staffMag(Fraction(0, 1)) * .5; y = e->y(); diff --git a/vtest/scores/fermata-4.mscz b/vtest/scores/fermata-4.mscz new file mode 100644 index 000000000000..e20c2fa1d086 Binary files /dev/null and b/vtest/scores/fermata-4.mscz differ