vexflow icon indicating copy to clipboard operation
vexflow copied to clipboard

Feature: SVG Scaling to parent

Open mix3d opened this issue 6 years ago • 7 comments

Using https://github.com/gristow/vexflow/commit/fbf3c782509aca357f0d6cf136480ac4b990a779 and the SVG interactions defined in #371 , to create a staff that scales to it's parent size, without needing to call renderer.resize() all the time.

Yes this won't be compatible with Canvas, but SVG is superior anyways soooo...

mix3d avatar Nov 10 '19 05:11 mix3d

To plan my usage of vexflow, I would like know if there is any plan to implement this in vexflow sometimes soon, or if I should find my own workarounds. Thanks!

davidedelvento avatar Apr 25 '20 23:04 davidedelvento

I posted that 6 months ago... You might need to fork.

mix3d avatar Apr 26 '20 01:04 mix3d

@mix3d Thanks. I did notice the date, but sometimes conversations happen on a side channel, so I wanted to check.

davidedelvento avatar Apr 26 '20 12:04 davidedelvento

Can you clarify what you mean? Do you mean that the VexFlow SVGContext is on a responsive webpage, so that as the parent DOM element resizes, the VexFlow score will also resize appropriately? Do you have a demo of it working? (Since this is almost 2 years ago now, I assume you might have already implemented it on your own fork.)

ronyeh avatar Oct 01 '21 02:10 ronyeh

I needed simply the staff to fill the available size, on a phone/table. I eventually had it to work just using what was available. I don't remember anything else since this is so old (I am not currently working on that project, at the moment)

davidedelvento avatar Oct 01 '21 11:10 davidedelvento

If we draw a background element this could help

https://stackoverflow.com/questions/19484707/how-can-i-make-an-svg-scale-with-its-parent-container

rvilarl avatar Apr 04 '23 05:04 rvilarl