Conversation
|
I'm on mobile, apologies for the lack of formatting. Hopefully this unblocks you. Right now, vexflow.Stave objects are created downstream in rendering.Part.getStaves. Some possible options:
|
|
Thanks! I am considering if it makes sense to have the stave. This is required to calculate the bounding box position correctly but not the height and width. |
|
In keysignature.ts, this seemed to fix it: private getVfKeySignature(): vexflow.KeySignature {
const vfStave = new vexflow.Stave(0, 0, 0);
const vfKeySignature = new vexflow.KeySignature(
this.getKey(),
this.previousKeySignature?.getKey() ?? undefined,
this.getAlterations()
).setPosition(vexflow.StaveModifierPosition.BEGIN);
vfKeySignature.addToStave(vfStave);
return vfKeySignature;
}However, I've been having issues running the test via |
|
I was able to run the tests. The change I mentioned does produce diffs, but they're negligible. |
|
I have set a PR in vexflow to avoid changes here.it should be allowed to get the width without assigning a Stave, I think. |
|
Thanks! I think that's a better solution since it will prevent other vexflow users from breaking. |
|
@rvilarl, I'm preparing to have this ready for VexFlow 5's release. Feel free to reach out to me when the issue we talked about has been addressed in VexFlow. |
|
@ronyeh could you release a beta? |
|
@jaredjj3 this should be fixed in the vexflow 5.0.0-beta.1 |
@jaredjj3 please help me fixing the error.
We need to set the stave before calling getWidth but I do not know how to get access to the stave in keysignature.ts