Remove parent binding to child

This commit is contained in:
2025-01-09 18:58:31 +01:00
parent 4d6b61e90e
commit 0e5dd00816
5 changed files with 991 additions and 893 deletions

View File

@@ -6,8 +6,6 @@
let ws: WebSocket | null = $state(null);
let image: HTMLImageElement | null = $state(null);
let parent: HTMLElement | null = $state(null);
let trackers: TrackerData[] = $state([
{ id: 1, x: 0, y: 0 },
{ id: 2, x: 0, y: 0 },
@@ -39,26 +37,18 @@
src="/scene_drawing.png"
alt=""
bind:this={image}
class="scale-50"
class="max-w-screen max-h-screen"
onload={resize}
/>
<div
bind:this={parent}
class="absolute inset-0 border border-red-500"
style={"width: " +
width +
"px; height: " +
height +
"px;" +
"transform: translate(50%, 50%);"}
>
<div class="absolute inset-0 border border-red-500">
{#each trackers as tracker}
<Drag
bind:id={tracker.id}
bind:x={tracker.x}
bind:y={tracker.y}
bind:width
bind:height
{ws}
{parent}
/>
{/each}
</div>