Skip to content

Commit 0e0af89

Browse files
authored
fix: remove incorrect screenLeft polyfill (#393)
* fix: remove incorrect screenLeft polyfill * refactor: initialize screen coordinates in separate declarations
1 parent 72c9e5c commit 0e0af89

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

‎screenleft-screentop/index.html‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,8 @@
3030

3131
const pElem = document.querySelector('p');
3232

33-
let initialTop, initialLeft;
34-
35-
if(!window.screenLeft) {
36-
window.screenLeft = window.screenX;
37-
window.screenTop = window.screenY;
38-
}
39-
40-
initialLeft = window.screenLeft + canvasElem.offsetLeft;
41-
initialTop = window.screenTop + canvasElem.offsetTop;
33+
let initialLeft = window.screenLeft + canvasElem.offsetLeft;
34+
let initialTop = window.screenTop + canvasElem.offsetTop;
4235

4336
function positionElem() {
4437
let newLeft = window.screenLeft + canvasElem.offsetLeft;

0 commit comments

Comments
 (0)