Skip to content

Commit

Permalink
fix event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
rejth committed May 21, 2024
1 parent 334dddd commit e12a99e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/ui/Canvas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@
height: _height,
pixelRatio: _pixelRatio,
});
const handleLayerTouchStart = (e: TouchEvent) => {
const { clientX, clientY } = e.changedTouches[0];
const { left, top } = (<Element>e.target).getBoundingClientRect();
const x = (clientX - left) * _pixelRatio;
const y = (clientY - top) * _pixelRatio;
const hexCode = renderManager.context.pickColor(x, y);
renderManager.selectedColor.set(hexCode);
};
</script>

<svelte:window bind:devicePixelRatio />
Expand All @@ -96,7 +87,7 @@
bind:this={canvasRef}
bind:clientWidth={canvasWidth}
bind:clientHeight={canvasHeight}
on:touchstart={handleLayerTouchStart}
on:touchstart={onClick}
on:touchmove={onMove}
on:mousedown={onClick}
on:mousemove={onMove}
Expand Down

0 comments on commit e12a99e

Please sign in to comment.