X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=files%2Fpr0n-fullscreen.js;h=d9d37c6131b8226a952e95677f2991d9e404f2d2;hp=9edac701a6be896aa0a53ab0c2221b1b2f1166f2;hb=028fd7f4a56f931d04a806f4356cf27b6d18f092;hpb=87067d612c3db377d5675c53a9e169ddf25f46d4 diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 9edac70..d9d37c6 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -381,11 +381,11 @@ function draw_text(msg) text.style.font = "24px verdana, arial, sans-serif"; text.innerHTML = msg; - var main = document.getElementById("main"); - main.appendChild(text); + document.getElementById("main").appendChild(text); - text.style.left = (main.clientWidth - text.clientWidth) / 2 + "px"; - text.style.top = (main.clientHeight - text.clientHeight) / 2 + "px"; + var screen_size = find_width(); + text.style.left = (screen_size[0] - text.clientWidth) / 2 + "px"; + text.style.top = (screen_size[1] - text.clientHeight) / 2 + "px"; } function fade_text(opacity)