Skip to content

Commit

Permalink
refactor: Drag, AdjustPitchFromPosition, add AdjustPitchAfterDrag
Browse files Browse the repository at this point in the history
- Refactor `Drag` for syllable, neume, and nc
- Add `AdjustPitchAfterDrag` to calculate pitch difference on `y` change, use `AdjustPitchFromPosition` only for `Insert`
- Refactor `AdjustPitchFromPosition`, reduce code duplication

refs: DDMAL/Neon#1250
  • Loading branch information
yinanazhou committed Dec 13, 2024
1 parent f649f45 commit 3c32804
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 222 deletions.
5 changes: 3 additions & 2 deletions include/vrv/editortoolkit_neume.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EditorToolkitNeume : public EditorToolkit {
///@{
bool Chain(jsonxx::Array actions);
bool DisplaceClefOctave(std::string elementId, std::string direction);
bool Drag(std::string elementId, int x, int y);
bool Drag(std::string elementId, int x, int y, bool topLevel = true);
bool Insert(std::string elementType, std::string staffId, int ulx, int uly, int lrx, int lry,
std::vector<std::pair<std::string, std::string>> attributes);
bool InsertToSyllable(std::string elementId);
Expand Down Expand Up @@ -102,7 +102,8 @@ class EditorToolkitNeume : public EditorToolkit {
* Helper functions for editor actions.
*/
///@{
bool AdjustPitchFromPosition(Object *obj, Clef *clef = NULL);
bool AdjustPitchAfterDrag(Object *obj, int y = 0);
bool AdjustPitchFromPosition(Object *obj);
bool AdjustClefLineFromPosition(Clef *clef, Staff *staff = NULL);
///@}
};
Expand Down
Loading

0 comments on commit 3c32804

Please sign in to comment.