From 6ec4c5d32d4e31feaecc5d77b178ddf16d5c6126 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 7 Aug 2024 13:18:38 -0500 Subject: [PATCH] Fix bg not handling windows not aligned to top left of screen --- site/.vitepress/theme/Background.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/.vitepress/theme/Background.vue b/site/.vitepress/theme/Background.vue index 6744c075..1104a64c 100644 --- a/site/.vitepress/theme/Background.vue +++ b/site/.vitepress/theme/Background.vue @@ -31,7 +31,7 @@ const cols = computed(() => Math.ceil(sizes.width.value / 304)); const mousePos = ref(new Vector2(Infinity, Infinity)); function updateMousePos(event: MouseEvent) { const {x, y, height} = renderer.value.domElement.getBoundingClientRect(); - mousePos.value = new Vector2(event.screenX - x, height + y + (window.outerHeight - window.innerHeight) - event.screenY); + mousePos.value = new Vector2(event.x - x, height + y - event.y); if (groupRef.value) { groupRef.value.children.forEach(child => { child.material.uniforms.uMouse.value = mousePos.value;