Re:Responsive images
by rikroots on Saturday June 12, 2021 @06:50AM
(#27483507)
One thing I learned about responsive images - <img> elements with a srcset attribute - while developing my JS canvas library is that if you're relying on those <img> elements to as the source for your ctx.drawImage() calls then the whole thing blows up in unexpected ways when the user changes their browser's size.
[ Parent
| on HN ]
In case anyone's interested, this is how I solved the problem so my library can work with responsive images: https://scrawl-v8.rikweb.org.uk/learn/second-lesson