Skip to content

Commit

Permalink
Merge pull request #6126 from igorkorsukov/tracker/305696_gliss
Browse files Browse the repository at this point in the history
fix #305696 Glissando not centered in palette
  • Loading branch information
anatoly-os committed May 27, 2020
1 parent aa44110 commit 7569d6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mscore/palette/palettetree.cpp
Expand Up @@ -986,7 +986,10 @@ static void paintScoreElement(QPainter& p, Element* e, qreal spatium, bool align
p.scale(sizeRatio, sizeRatio); // scale coordinates so element is drawn at correct size

e->layout(); // calculate bbox
QPointF origin = e->bbox().center();

//! NOTE `static_cast<const Element*>(e)` is needed for the `const QRectF& bbox() const` method to be called
//! This method is overridden for some elements, in particular for Glissando
QPointF origin = static_cast<const Element* >(e)->bbox().center();

if (alignToStaff) {
origin.setY(0.0); // y = 0 is position of the element's parent.
Expand Down

0 comments on commit 7569d6c

Please sign in to comment.