Skip to content

Commit b747d68

Browse files
committed
fix: remove references to window
1 parent cb250ff commit b747d68

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/LayeredImage.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,9 @@ export const LayeredImage: React.FC<ILayeredImageProps> = ({
128128
const { width, height } = _interaction === Interaction.Resize ? getDimensions() : size
129129

130130
const bodyScrollTop =
131-
document.body.scrollTop ||
132-
document.documentElement.scrollTop ||
133-
document.scrollingElement.scrollTop ||
134-
window.scrollY ||
135-
window.pageYOffset
131+
document.body.scrollTop || document.documentElement.scrollTop || document.scrollingElement.scrollTop
136132
const bodyScrollLeft =
137-
document.body.scrollLeft ||
138-
document.documentElement.scrollLeft ||
139-
document.scrollingElement.scrollLeft ||
140-
window.scrollX ||
141-
window.pageXOffset
133+
document.body.scrollLeft || document.documentElement.scrollLeft || document.scrollingElement.scrollLeft
142134
const containerRect = elementsRef.current.container.current.getBoundingClientRect()
143135

144136
const offsetX = (pageX - containerRect.left - bodyScrollLeft) / width

0 commit comments

Comments
 (0)