From 4d8de50d58c6fc71ed3a922817567f92129ab111 Mon Sep 17 00:00:00 2001 From: "azykov@mail.ru" Date: Tue, 2 Jun 2026 13:58:42 +0300 Subject: [PATCH] more precise object click handling --- src/components/ObjectView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ObjectView.tsx b/src/components/ObjectView.tsx index 97d79d6..cd6cf07 100644 --- a/src/components/ObjectView.tsx +++ b/src/components/ObjectView.tsx @@ -3,6 +3,7 @@ import type { ObjectInstance } from "../types"; import { useEffect, useRef, type RefObject } from "react"; import type { Group, Mesh } from "three"; import { Edges, TransformControls } from "@react-three/drei"; +import type { ThreeEvent } from "@react-three/fiber"; import { state } from "../state"; import { nextSelectionEditMode } from "../state/worldEditor"; import type { R3 } from "../types/3d"; @@ -38,9 +39,11 @@ export const ObjectView = observer(function ({ object }: ObjectViewProps) { }; }, [isSelected]); - const handleClick = (e: { stopPropagation: () => void }) => { + const handleClick = (e: ThreeEvent) => { if (!state.worldEditor.isEnabled) return; + if (e.delta > 5) + return; e.stopPropagation(); state.worldEditor.setSelectedObject(object.id, nextSelectionEditMode(selectionMode));