From 1279a667a73e14c961e9f708835cf1a569ee8b81 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 25 Aug 2007 03:02:17 +0200 Subject: [PATCH] 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. --- files/pr0n-fullscreen.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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"; -- 2.39.2