From: Steinar H. Gunderson Date: Wed, 15 Jul 2020 17:50:29 +0000 (+0200) Subject: Some infobox adjustments. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=ac807f22ca9d12ba0349f963734eaaed6401694a Some infobox adjustments. --- diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 45b60c6..076c626 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -243,7 +243,9 @@ function position_image(img, backend_width, backend_height, offset, box) var left = (screen_size[0] - width) / 2; var top = (screen_size[1] - height) / 2; - if (global_infobox) top -= dpr * (24/2); + if (global_infobox) { + top = Math.max(top - dpr * (24/2), 0); + } // center the image on-screen img.style.position = "absolute"; @@ -251,7 +253,7 @@ function position_image(img, backend_width, backend_height, offset, box) img.style.transform = "translate(" + extra_x_offset + "px,0px)"; if (box) { - img.style.top = (top + height) / dpr + "px"; + img.style.top = Math.min(top + height, screen_size[1] - 24) / dpr + "px"; } else { img.style.top = (top / dpr) + "px"; img.style.lineHeight = (height / dpr) + "px";