From: Steinar H. Gunderson Date: Sat, 25 Aug 2007 01:02:17 +0000 (+0200) Subject: In fullscreen mode, crop the image div to the screen. This makes sure the X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=1279a667a73e14c961e9f708835cf1a569ee8b81;ds=sidebyside In fullscreen mode, crop the image div to the screen. This makes sure the new "oversized"-image code doesn't make a div that is too high and allows the user to scroll by accident. --- diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 37fd673..db9d434 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -221,6 +221,14 @@ function center_image(num) adjusted_size = pick_image_size(screen_size, [ global_image_list[num][2], global_image_list[num][3] ]); } + // crop the div to the screen + if (adjusted_size[0] > screen_size[0]) { + adjusted_size[0] = screen_size[0]; + } + if (adjusted_size[1] > screen_size[1]) { + adjusted_size[1] = screen_size[1]; + } + // center the image on-screen var main = document.getElementById("main"); main.style.position = "absolute";