mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: stop track propogation
This commit is contained in:
1 parent
b7eae89a4e
commit
5c787dfd7f
1 file changed
+11
-9
@@ -144,17 +144,19 @@ export const TankModel = memo(() => {
|
||||
}
|
||||
|
||||
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
||||
if (!isTrack) return;
|
||||
if (isTrack) {
|
||||
position.set(event.clientX, event.clientY);
|
||||
event.stopPropagation();
|
||||
|
||||
position.set(event.clientX, event.clientY);
|
||||
event.stopPropagation();
|
||||
mutateTankopediaTemporary((draft) => {
|
||||
draft.controlsEnabled = false;
|
||||
});
|
||||
|
||||
mutateTankopediaTemporary((draft) => {
|
||||
draft.controlsEnabled = false;
|
||||
});
|
||||
|
||||
window.addEventListener('pointermove', handlePointerMove);
|
||||
window.addEventListener('pointerup', handlePointerUp);
|
||||
window.addEventListener('pointermove', handlePointerMove);
|
||||
window.addEventListener('pointerup', handlePointerUp);
|
||||
} else {
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
function handlePointerMove(event: PointerEvent) {
|
||||
delta.set(event.clientX, event.clientY).sub(position);
|
||||
|
||||
Reference in new issue
Block a user