feat: Update pointer event handling in Model and WallAssetInstance components for improved interaction

This commit is contained in:
2025-07-08 11:44:25 +05:30
parent 0e0f48ac02
commit 1b736dafce
2 changed files with 17 additions and 17 deletions

View File

@@ -270,8 +270,8 @@ function Model({ asset }: { readonly asset: Asset }) {
}
}, [activeTool, activeModule, deletableFloorItem]);
const handlePointerOut = useCallback((asset: Asset) => {
if (activeTool === "delete" && deletableFloorItem && deletableFloorItem.uuid === asset.modelUuid) {
const handlePointerOut = useCallback((evt: ThreeEvent<MouseEvent>, asset: Asset) => {
if (evt.intersections.length === 0 && activeTool === "delete" && deletableFloorItem && deletableFloorItem.uuid === asset.modelUuid) {
setDeletableFloorItem(null);
}
}, [activeTool, deletableFloorItem]);
@@ -369,27 +369,27 @@ function Model({ asset }: { readonly asset: Asset }) {
visible={asset.isVisible}
userData={asset}
onDoubleClick={(e) => {
e.stopPropagation();
if (!toggleView) {
e.stopPropagation();
handleDblClick(asset);
}
}}
onClick={(e) => {
e.stopPropagation();
if (!toggleView) {
e.stopPropagation();
handleClick(asset);
}
}}
onPointerEnter={(e) => {
onPointerOver={(e) => {
e.stopPropagation();
if (!toggleView) {
e.stopPropagation();
handlePointerOver(asset);
}
}}
onPointerOut={(e) => {
onPointerLeave={(e) => {
e.stopPropagation();
if (!toggleView) {
e.stopPropagation();
handlePointerOut(asset);
handlePointerOut(e, asset);
}
}}
onContextMenu={(e) => {