Open h-sug1no opened 2 years ago
Specifying preserveAspectRatio="none" in the svg data improves the problem in safari and does not seem to cause any side effects in other UAs.
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="480" preserveAspectRatio="none">
<path fill="#fff" stroke="#000" d="M0,0 h24v480h-24z"/>
<path fill="#000" d="M0,40 h12v40h-12z M0,120 h12v40h-12z M0,200 h12v40h-12z M0,320 h12v40h-12z M0,400 h12v40h-12z"/>
<path fill="none" stroke="#000" d="M0,60 h24 M0,140 h24 M0,220 h24 M0,280 h24 M0,340 h24 M0,420 h24"/>
</svg>
Just noticed this too when testing on safari - the fix from @h-sug1no does work great to fix it
Hi,
https://g200kg.github.io/webaudio-pianoroll/index2.html
With macOS safari(macOS safari 15.0(16612.1.29.41.4, 16612)), the width of the background-image of the kbdimg is calculated to be narrower as follows: