Fixed resize issue for firefox -.-

This commit is contained in:
Toerd@480 2019-10-23 23:44:18 +02:00
parent 5354aac4bf
commit e0b2685b16

View File

@ -14,6 +14,10 @@ function zoom(factor, imgName) {
let offset = {x: img.width * factor, y: img.height * factor};
// Fix for firefox, somehow width larger than content (inline-block)
magni.style.width = img.width;
window.addEventListener("resize", () => {
magni.style.width = "60%";
magni.style.width = img.width;
});
// setup the padding (bigger zoom canvas)
magni.style.padding = offset.y + "px " + offset.x + "px";
// adjust the margin to ged rid of the extra size gained from padding