From 23e9b8eb57f8e34e403deef9006f46e08aa343a4 Mon Sep 17 00:00:00 2001 From: ws Date: Thu, 29 Nov 2018 17:44:44 +0100 Subject: [PATCH] fix #277759 Chord symbols sometimes add (much) too much space to measure --- libmscore/chordrest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libmscore/chordrest.cpp b/libmscore/chordrest.cpp index 0be1039483..1895755f89 100644 --- a/libmscore/chordrest.cpp +++ b/libmscore/chordrest.cpp @@ -1180,13 +1180,14 @@ Shape ChordRest::shape() const for (Element* e : segment()->annotations()) { if (e->isHarmony() && e->staffIdx() == staffIdx()) { e->layout(); - x1 = qMin(x1, e->bbox().x() + e->pos().x()); - x2 = qMax(x2, x1 + e->bbox().width()); + qreal hx = e->bbox().x() - e->pos().x(); + x1 = qMin(x1, hx); + x2 = qMax(x2, hx + e->bbox().width()); adjustWidth = true; } } if (adjustWidth) - shape.add(QRectF(x1, 0.0, x2-x1, 1.0)); + shape.add(QRectF(x1, 0.0, x2-x1, 0.0)); return shape; }