vexflow icon indicating copy to clipboard operation
vexflow copied to clipboard

`getClef` & `getEndClef` in `Stave` do not provide all the information required to build a `Clef`

Open rvilarl opened this issue 2 years ago • 3 comments

Both setClef and setEndClef have the following parameters:

clefSpec: string, size?: string, annotation?: string

getClef and getEndClef only return the clefSpec

rvilarl avatar Sep 29 '22 15:09 rvilarl

Also Clef provides no method to get the parameters above used in its constructor.

rvilarl avatar Sep 29 '22 15:09 rvilarl

I believe that it should be allowed to get the three parameters from getClef, getEndClef and Clef.

rvilarl avatar Sep 29 '22 15:09 rvilarl

This also relates somehow to #580 I believe we are missing a consitent way to copy elements. I have think about the following possibilities:

  • use overlay copy contructors in all classes like in Renderer. This would allow to make a copy of Clef. getClef and getEndClef could return the Clef object and then make a copy of it.
  • have a static copy function in the elements with the same purpose.

Thoughts? Do you have other ideas?

rvilarl avatar Sep 29 '22 20:09 rvilarl