From c0a21058d46f12a2616661cd851d8b8c6055f964 Mon Sep 17 00:00:00 2001 From: sudhir Date: Thu, 7 May 2026 17:01:06 +0530 Subject: [PATCH] fix list --- .../tools/item/placement-strategies.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/editor/src/components/tools/item/placement-strategies.ts b/packages/editor/src/components/tools/item/placement-strategies.ts index 6d93b6de..f4d4abd1 100644 --- a/packages/editor/src/components/tools/item/placement-strategies.ts +++ b/packages/editor/src/components/tools/item/placement-strategies.ts @@ -9,7 +9,12 @@ import type { WallEvent, WallNode, } from '@pascal-app/core' -import { getScaledDimensions, sceneRegistry, useScene } from '@pascal-app/core' +import { + getScaledDimensions, + isLowProfileItemSurface, + sceneRegistry, + useScene, +} from '@pascal-app/core' import { Euler, Matrix3, Quaternion, Vector3 } from 'three' import { calculateCursorRotation, @@ -31,17 +36,8 @@ import type { } from './placement-types' const DEFAULT_DIMENSIONS: [number, number, number] = [1, 1, 1] -const LOW_PROFILE_ITEM_SURFACE_MAX_HEIGHT = 0.1 const UPWARD_SURFACE_NORMAL_MIN_Y = 0.75 -function isLowProfileItemSurface(item: ItemNode): boolean { - if (item.asset.attachTo) return false - const surfaceHeight = item.asset.surface - ? item.asset.surface.height * item.scale[1] - : getScaledDimensions(item)[1] - return surfaceHeight <= LOW_PROFILE_ITEM_SURFACE_MAX_HEIGHT -} - function getWorldNormalY(event: ItemEvent): number | null { if (!event.normal) return null