]> git.sesse.net Git - pr0n/blobdiff - files/pr0n-fullscreen.js
Fix infobox with DPR != 1.
[pr0n] / files / pr0n-fullscreen.js
index a8ad78a9d0296ea912ba8ffab9840a9e68f620fc..e81fd37886a6a3e718a1be8c4c94b760abf6c553 100644 (file)
@@ -133,7 +133,8 @@ function display_image(url, backend_width, backend_height, elem_id, offset, prel
 
                // Seemingly one needs to delay position_image(), or Firefox will set the initial
                // scroll offset completely off.
-               setTimeout(function() { position_image(img, backend_width, backend_height, offset, preload); }, 1);
+               img.style.display = 'none';
+               setTimeout(function() { position_image(img, backend_width, backend_height, offset, preload); img.style.display = null; }, 1);
        }
 }
 
@@ -168,6 +169,7 @@ function display_image_num(num, offset)
                        url = window.location.origin + "/" + evt + "/" + backend_width + "x" + backend_height + "@" + dpr.toFixed(2) + "/box/" + filename;
                }
                display_image(url, adjusted_size[2], adjusted_size[3], elem_id, offset, true);
+               document.getElementById(elem_id).style.transform += " scale(" + (1.0 / dpr) + ")";
        }
 
        if (offset === 0) {