@@ -804,21 +804,6 @@ std::vector<String> FretDiagram::patternHarmonies(const String& pattern)
804
804
return muse::value (s_diagramPatternToHarmoniesMap, pattern);
805
805
}
806
806
807
- void FretDiagram::applyAlignmentToHarmony ()
808
- {
809
- if (m_harmony->propertyFlags (Pid::OFFSET) == PropertyFlags::STYLED) {
810
- m_harmony->resetProperty (Pid::OFFSET);
811
- }
812
-
813
- m_harmony->setProperty (Pid::ALIGN, Align (AlignH::HCENTER, AlignV::BASELINE));
814
- m_harmony->setPropertyFlags (Pid::ALIGN, PropertyFlags::UNSTYLED);
815
- }
816
-
817
- void FretDiagram::resetHarmonyAlignment ()
818
- {
819
- m_harmony->resetProperty (Pid::ALIGN);
820
- }
821
-
822
807
// ---------------------------------------------------------
823
808
// clear
824
809
// ---------------------------------------------------------
@@ -946,38 +931,6 @@ void FretDiagram::setHarmony(String harmonyText)
946
931
triggerLayout ();
947
932
}
948
933
949
- void FretDiagram::linkHarmony (Harmony* harmony)
950
- {
951
- m_harmony = harmony;
952
-
953
- setParent (harmony->explicitParent ());
954
- harmony->setParent (this );
955
-
956
- // ! on the same lavel as diagram
957
- m_harmony->setZ (z ());
958
-
959
- if (Segment* segment = this ->segment ()) {
960
- segment->removeAnnotation (harmony);
961
- }
962
-
963
- m_harmony->setTrack (track ());
964
-
965
- applyAlignmentToHarmony ();
966
- }
967
-
968
- void FretDiagram::unlinkHarmony ()
969
- {
970
- m_harmony->setTrack (track ());
971
-
972
- resetHarmonyAlignment ();
973
-
974
- m_harmony->setZ (-1 );
975
-
976
- segment ()->add (m_harmony);
977
-
978
- m_harmony = nullptr ;
979
- }
980
-
981
934
// ---------------------------------------------------------
982
935
// add
983
936
// ---------------------------------------------------------
@@ -990,9 +943,6 @@ void FretDiagram::add(EngravingItem* e)
990
943
991
944
m_harmony->setTrack (track ());
992
945
993
- // ! on the same lavel as diagram
994
- m_harmony->setZ (z ());
995
-
996
946
if (m_harmony->harmonyName ().empty ()) {
997
947
if (s_diagramPatternToHarmoniesMap.empty ()) {
998
948
readHarmonyToDiagramFile (HARMONY_TO_DIAGRAM_FILE_PATH);
@@ -1007,7 +957,7 @@ void FretDiagram::add(EngravingItem* e)
1007
957
}
1008
958
}
1009
959
1010
- applyAlignmentToHarmony ( );
960
+ m_harmony-> resetProperty (Pid::OFFSET );
1011
961
1012
962
e->added ();
1013
963
} else {
@@ -1355,7 +1305,7 @@ FretDiagram* FretDiagram::makeFromHarmonyOrFretDiagram(const EngravingItem* harm
1355
1305
1356
1306
fretDiagram->updateDiagram (harmony->plainText ());
1357
1307
1358
- fretDiagram->linkHarmony (harmony);
1308
+ fretDiagram->add (harmony);
1359
1309
} else if (harmonyOrFretDiagram->isHarmony () && harmonyOrFretDiagram->parentItem ()->isFretDiagram ()) {
1360
1310
fretDiagram = toFretDiagram (harmonyOrFretDiagram->parentItem ())->clone ();
1361
1311
} else if (harmonyOrFretDiagram->isFretDiagram ()) {
0 commit comments