Skip to content

Commit ff1d91f

Browse files
cbjeukendrupmiiizen
authored andcommitted
Fix reading line width property of SLine
Resolves: #30241 The problem was that propertyFlags were not set to UNSTYLED where necessary, and therefore the value was overridden in `styleChanged`.
1 parent 36c874d commit ff1d91f

File tree

4 files changed

+19
-40
lines changed

4 files changed

+19
-40
lines changed

src/engraving/dom/property.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static constexpr PropertyMetaData propertyList[] = {
222222
{ Pid::GLISS_SHIFT, false, "glissandoShift", P_TYPE::BOOL, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "glissando shift") },
223223
{ Pid::GLISS_EASEIN, false, "easeInSpin", P_TYPE::INT, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "ease in") },
224224
{ Pid::GLISS_EASEOUT, false, "easeOutSpin", P_TYPE::INT, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "ease out") },
225-
{ Pid::DIAGONAL, false, "", P_TYPE::BOOL, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "diagonal") },
225+
{ Pid::DIAGONAL, false, "diagonal", P_TYPE::BOOL, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "diagonal") },
226226
{ Pid::GROUP_NODES, false, "", P_TYPE::GROUPS, PropertyGroup::NONE, QT_TRANSLATE_NOOP("engraving/propertyName", "groups") },
227227
{ Pid::LINE_STYLE, true, "lineStyle", P_TYPE::LINE_TYPE, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "line style") },
228228
{ Pid::LINE_WIDTH, false, "lineWidth", P_TYPE::SPATIUM, PropertyGroup::APPEARANCE, QT_TRANSLATE_NOOP("engraving/propertyName", "line width") },

src/engraving/rw/read400/tread.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,20 +3573,13 @@ bool TRead::readProperties(SLine* l, XmlReader& e, ReadContext& ctx)
35733573
ls->setVisible(l->visible());
35743574
} else if (tag == "length") {
35753575
l->setLen(e.readDouble());
3576-
} else if (tag == "diagonal") {
3577-
l->setDiagonal(e.readInt());
3578-
} else if (tag == "anchor") {
3579-
l->setAnchor(SLine::Anchor(e.readInt()));
3580-
} else if (tag == "lineWidth") {
3581-
l->setLineWidth(Spatium(e.readDouble()));
3576+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DIAGONAL)) {
3577+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::ANCHOR)) {
3578+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::LINE_WIDTH)) {
35823579
} else if (TRead::readProperty(l, tag, e, ctx, Pid::LINE_STYLE)) {
3583-
} else if (tag == "dashLineLength") {
3584-
l->setDashLineLen(e.readDouble());
3585-
} else if (tag == "dashGapLength") {
3586-
l->setDashGapLen(e.readDouble());
3587-
} else if (tag == "lineColor") {
3588-
l->setLineColor(e.readColor());
3589-
} else if (tag == "color") {
3580+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DASH_LINE_LEN)) {
3581+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DASH_GAP_LEN)) {
3582+
} else if (tag == "lineColor" || tag == "color") {
35903583
l->setLineColor(e.readColor());
35913584
} else if (!readProperties(static_cast<Spanner*>(l), e, ctx)) {
35923585
return false;

src/engraving/rw/read410/tread.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,20 +3767,13 @@ bool TRead::readProperties(SLine* l, XmlReader& e, ReadContext& ctx)
37673767
ls->setVisible(l->visible());
37683768
} else if (tag == "length") {
37693769
l->setLen(e.readDouble());
3770-
} else if (tag == "diagonal") {
3771-
l->setDiagonal(e.readInt());
3772-
} else if (tag == "anchor") {
3773-
l->setAnchor(SLine::Anchor(e.readInt()));
3774-
} else if (tag == "lineWidth") {
3775-
l->setLineWidth(Spatium(e.readDouble()));
3770+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DIAGONAL)) {
3771+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::ANCHOR)) {
3772+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::LINE_WIDTH)) {
37763773
} else if (TRead::readProperty(l, tag, e, ctx, Pid::LINE_STYLE)) {
3777-
} else if (tag == "dashLineLength") {
3778-
l->setDashLineLen(e.readDouble());
3779-
} else if (tag == "dashGapLength") {
3780-
l->setDashGapLen(e.readDouble());
3781-
} else if (tag == "lineColor") {
3782-
l->setLineColor(e.readColor());
3783-
} else if (tag == "color") {
3774+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DASH_LINE_LEN)) {
3775+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DASH_GAP_LEN)) {
3776+
} else if (tag == "lineColor" || tag == "color") {
37843777
l->setLineColor(e.readColor());
37853778
} else if (!readProperties(static_cast<Spanner*>(l), e, ctx)) {
37863779
return false;

src/engraving/rw/read460/tread.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3637,20 +3637,13 @@ bool TRead::readProperties(SLine* l, XmlReader& e, ReadContext& ctx)
36373637
ls->setVisible(l->visible());
36383638
} else if (tag == "length") {
36393639
l->setLen(e.readDouble());
3640-
} else if (tag == "diagonal") {
3641-
l->setDiagonal(e.readInt());
3642-
} else if (tag == "anchor") {
3643-
l->setAnchor(SLine::Anchor(e.readInt()));
3644-
} else if (tag == "lineWidth") {
3645-
l->setLineWidth(Spatium(e.readDouble()));
3640+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DIAGONAL)) {
3641+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::ANCHOR)) {
3642+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::LINE_WIDTH)) {
36463643
} else if (TRead::readProperty(l, tag, e, ctx, Pid::LINE_STYLE)) {
3647-
} else if (tag == "dashLineLength") {
3648-
l->setDashLineLen(e.readDouble());
3649-
} else if (tag == "dashGapLength") {
3650-
l->setDashGapLen(e.readDouble());
3651-
} else if (tag == "lineColor") {
3652-
l->setLineColor(e.readColor());
3653-
} else if (tag == "color") {
3644+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DASH_LINE_LEN)) {
3645+
} else if (TRead::readProperty(l, tag, e, ctx, Pid::DASH_GAP_LEN)) {
3646+
} else if (tag == "lineColor" || tag == "color") {
36543647
l->setLineColor(e.readColor());
36553648
} else if (!readProperties(static_cast<Spanner*>(l), e, ctx)) {
36563649
return false;

0 commit comments

Comments
 (0)