Skip to content

Commit

Permalink
Merge pull request musescore#24771 from mike-spa/fixHairpinApertureNo…
Browse files Browse the repository at this point in the history
…tSaved

Fix hairpin aperture not saved
  • Loading branch information
mike-spa committed Sep 20, 2024
1 parent 421bf24 commit fe42e05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/engraving/dom/hairpin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ EngravingItem* HairpinSegment::drop(EditData& data)
return d;
}

void HairpinSegment::setPropertyFlags(Pid id, PropertyFlags f)
{
int i = getPropertyFlagsIdx(id);
if (i == -1) {
// Can happen (for example when edit-dragging the aperture) that we're editing
// the HairpinSegment but the relevant property belongs to the Hairpin.
hairpin()->setPropertyFlags(id, f);
return;
}
m_propertyFlagsList[i] = f;
}

//---------------------------------------------------------
// gripsPositions
//---------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/engraving/dom/hairpin.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class HairpinSegment final : public TextLineBaseSegment
bool acceptDrop(EditData&) const override;
EngravingItem* drop(EditData&) override;

void setPropertyFlags(Pid id, PropertyFlags f) override;

bool m_drawCircledTip = false;
PointF m_circledTip;
double m_circledTipRadius = 0.0;
Expand Down
4 changes: 4 additions & 0 deletions src/engraving/rw/write/twrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ void TWrite::writeProperties(const TextLineBase* item, XmlWriter& xml, WriteCont
writeProperty(item, xml, pid);
}
}

writeProperties(static_cast<const SLine*>(item), xml, ctx);
}

Expand Down Expand Up @@ -1606,6 +1607,9 @@ void TWrite::write(const Hairpin* item, XmlWriter& xml, WriteContext& ctx)
writeProperty(item, xml, Pid::SNAP_BEFORE);
writeProperty(item, xml, Pid::SNAP_AFTER);

writeProperty(item, xml, Pid::HAIRPIN_HEIGHT);
writeProperty(item, xml, Pid::HAIRPIN_CONT_HEIGHT);

writeProperties(static_cast<const TextLineBase*>(item), xml, ctx);
xml.endElement();
}
Expand Down

0 comments on commit fe42e05

Please sign in to comment.