Skip to content

Commit

Permalink
Fix fermata placement on ledger-line rests
Browse files Browse the repository at this point in the history
  • Loading branch information
miiizen committed Sep 29, 2023
1 parent 62580c5 commit 34be935
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/engraving/dom/rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ double Rest::rightEdge() const

double Rest::centerX() const
{
return score()->engravingFont()->width(layoutData()->sym(), mag()) / 2;
SymId sym = layoutData()->sym();
RectF bbox = symBbox(sym);
return bbox.left() + bbox.width() / 2;
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/dev/tlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ void TLayout::layout(const Fermata* item, Fermata::LayoutData* ldata, const Layo
y = chord->y();
} else if (e->isRest()) {
const Rest* rest = toRest(e);
x = rest->pos().x() + rest->centerX();
x = rest->x() + rest->centerX();
y = rest->y();
} else {
x = e->x() - e->shape().left() + e->width() * item->staff()->staffMag(Fraction(0, 1)) * .5;
Expand Down

0 comments on commit 34be935

Please sign in to comment.