Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hairpin aperture not saved #24771

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1573,6 +1573,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 @@ -1604,6 +1605,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