Skip to content

Drag Action

jacob-hutnyk edited this page Jul 18, 2019 · 1 revision

Drag Action Algorithm

The process for handling drag actions depends on the element. There are four cases: staff, clef, syl/text bounding box, and other.

If a staff is dragged, the position of the staff bounding box is changed. The MEI file is then sorted so the staves appear in the correct order.

If a clef is dragged, the line is updated (if applicable) and the clef pitch algorithm is run.

If a text bounding box is dragged, the position of the bounding box is modified and none if its parents move.

In the case of any other element, it is handled generically based on the features the element class has. It follows the flowchart below where "bbox" stands for "bounding box".

Generic drag flowchart