esonderegger / web-audio-peak-meter

Customizable peak meters, using the web audio API.
https://esonderegger.github.io/web-audio-peak-meter/
MIT License
125 stars 33 forks source link

How to properly resize it? #27

Open wargebitebane opened 2 years ago

wargebitebane commented 2 years ago

Thanks a lot for awesome library. All elements are positioned by px but what if main container is resizing?

suterma commented 1 year ago

As it currently stands, it does not dynamically resize, but adjusts itself to the size of the div at creation time.

@esonderegger I would suggest to improve this by not calculating absolute pixels but percent values for all the elements. If you are interested, I could try something out and offer as PR.

esonderegger commented 1 year ago

Thank you for the kind words! This has been fixed in version 3 of this library - all the relevant sizing and positioning is now done via percentages, so it should adjust automatically when its parent container is resized.