feat: Update pointer event handling in Model and WallAssetInstance components for improved interaction
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user