From d7cea96940ddeb764c7343e05526f611863019d8 Mon Sep 17 00:00:00 2001
From: Ruben Beltran del Rio <ruben@unlimited.pizza>
Date: Thu, 7 Jul 2022 23:14:18 +0200
Subject: Partially render the boxes

---
 src/lib/components/background.svelte | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'src/lib/components/background.svelte')

diff --git a/src/lib/components/background.svelte b/src/lib/components/background.svelte
index 7664939..03c5377 100644
--- a/src/lib/components/background.svelte
+++ b/src/lib/components/background.svelte
@@ -1,16 +1,14 @@
 <script>
   import { browser } from '$app/env';
-
-  export let x;
-  export let y;
+  import { canvas } from '$lib/stores/canvas';
 
   const kDotSize = 32;
 
   $: {
     if (browser) {
       document.documentElement.style.setProperty('--dot-size', kDotSize + 'px');
-      document.documentElement.style.setProperty('--dot-x', kDotSize - x % kDotSize + 'px');
-      document.documentElement.style.setProperty('--dot-y', kDotSize - y % kDotSize + 'px');
+      document.documentElement.style.setProperty('--dot-x', kDotSize - $canvas.x % kDotSize + 'px');
+      document.documentElement.style.setProperty('--dot-y', kDotSize - $canvas.y % kDotSize + 'px');
     }
   }
 </script>
-- 
cgit 

