diff --git a/libmscore/box.cpp b/libmscore/box.cpp index c4bc774a48e4..71180f221a9a 100644 --- a/libmscore/box.cpp +++ b/libmscore/box.cpp @@ -386,6 +386,24 @@ QVariant Box::propertyDefault(P_ID id) const } } +//--------------------------------------------------------- +// copyValues +//--------------------------------------------------------- + +void Box::copyValues(Box* origin) + { + _boxHeight = origin->boxHeight(); + _boxWidth = origin->boxWidth(); + + qreal factor = magS() / origin->magS(); + _bottomGap = origin->bottomGap() * factor; + _topGap = origin->topGap() * factor; + _bottomMargin = origin->bottomMargin() * factor; + _topMargin = origin->topMargin() * factor; + _leftMargin = origin->leftMargin() * factor; + _rightMargin = origin->rightMargin() * factor; + } + //--------------------------------------------------------- // HBox //--------------------------------------------------------- diff --git a/libmscore/box.h b/libmscore/box.h index 06092db61f8b..4ac97d05a53d 100644 --- a/libmscore/box.h +++ b/libmscore/box.h @@ -79,6 +79,7 @@ class Box : public MeasureBase { void setTopGap(qreal val) { _topGap = val; } qreal bottomGap() const { return _bottomGap; } void setBottomGap(qreal val) { _bottomGap = val; } + void copyValues(Box* origin); virtual QVariant getProperty(P_ID propertyId) const override; virtual bool setProperty(P_ID propertyId, const QVariant&) override; diff --git a/libmscore/excerpt.cpp b/libmscore/excerpt.cpp index 2a26d5aa949c..9d75cdae91b4 100644 --- a/libmscore/excerpt.cpp +++ b/libmscore/excerpt.cpp @@ -140,10 +140,15 @@ void createExcerpt(Score* score, const QList& parts) // create title frame for all scores if not already there if (!measure || (measure->type() != Element::Type::VBOX)) - oscore->insertMeasure(Element::Type::VBOX, measure); + measure = oscore->insertMeasure(Element::Type::VBOX, measure); + VBox* titleFrameScore = static_cast(measure); measure = score->first(); + Q_ASSERT(measure->type() == Element::Type::VBOX); + + VBox* titleFramePart = static_cast(measure); + titleFramePart->copyValues(titleFrameScore); QString partLabel = parts.front()->longName(); if (!partLabel.isEmpty()) { Text* txt = new Text(score);