Fix centering of text again.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 14 Jul 2020 13:07:33 +0000 (15:07 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 14 Jul 2020 13:07:33 +0000 (15:07 +0200)
files/pr0n-fullscreen.js

index 9edac701a6be896aa0a53ab0c2221b1b2f1166f2..d9d37c6131b8226a952e95677f2991d9e404f2d2 100644 (file)
@@ -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)