X-Git-Url: https://git.r.bdr.sh/rbdr/canvas/blobdiff_plain/3717f7fbf9ec110b51fe002cdced5d73ebd6136b..587d8fe65d61b8f7217b4e8850b44e43159c16fb:/src/lib/components/hud.svelte?ds=sidebyside

diff --git a/src/lib/components/hud.svelte b/src/lib/components/hud.svelte
index ce32e0d..a115c91 100644
--- a/src/lib/components/hud.svelte
+++ b/src/lib/components/hud.svelte
@@ -1,30 +1,26 @@
 <script>
-  export let x;
-  export let y;
+	import { coordinateLength } from '$lib/config';
+	import { canvas } from '$lib/stores/canvas';
 
-  const kCoordinateLength = 6;
-  const kSeparatorRegex = /([0-9a-z]{2})/g;
+	const kSeparatorRegex = /([0-9a-z]{2})/g;
 
-  const formatCoordinate = function formatCoordinate(coordinate) {
-    return coordinate
-      .toString(16)
-      .padStart(kCoordinateLength, 0)
-      .replace(kSeparatorRegex, '$1 ');
-  }
+	const formatCoordinate = function formatCoordinate(coordinate) {
+		return coordinate.toString(16).padStart(coordinateLength, 0).replace(kSeparatorRegex, '$1 ');
+	};
 </script>
 
 <div class="hud">
-  { formatCoordinate(x) } Ã { formatCoordinate(y) }
+	{formatCoordinate($canvas.x)} Ã {formatCoordinate($canvas.y)}
 </div>
 
 <style>
-  .hud {
-    background-color: #fff;
-    padding: 4px;
-    position: fixed;
-    bottom: 2px;
-    right: 2px;
-    font-smooth: never;
-    -webkit-font-smoothing : none;
-  }
+	.hud {
+		background-color: #fff;
+		padding: 4px;
+		position: fixed;
+		bottom: 2px;
+		right: 2px;
+		font-smooth: never;
+		-webkit-font-smoothing: none;
+	}
 </style>
