Merge pull request #294 from pascalorg/chore/items-catalog-update
Chore/items catalog update
This commit is contained in:
@@ -5156,15 +5156,6 @@ const FloorplanFenceLayer = memo(function FloorplanFenceLayer({
|
|||||||
// Renders an item's 2D floor-plan image (top-down view, object-fit:contain)
|
// Renders an item's 2D floor-plan image (top-down view, object-fit:contain)
|
||||||
// inside its footprint rectangle. Placed at the same scene position/rotation
|
// inside its footprint rectangle. Placed at the same scene position/rotation
|
||||||
// as the polygon so it lines up exactly.
|
// as the polygon so it lines up exactly.
|
||||||
const FLOORPLAN_ITEM_ICON_OVERRIDES: Record<string, string> = {
|
|
||||||
'office-chair': '/items/office-chair/floor-plan.svg',
|
|
||||||
sofa: '/items/sofa/floor-plan.svg',
|
|
||||||
}
|
|
||||||
const FLOORPLAN_ITEMS_WITH_SELF_OUTLINED_ICON = new Set(['office-chair', 'sofa'])
|
|
||||||
|
|
||||||
function getFloorplanItemIconUrl(item: ItemNode) {
|
|
||||||
return FLOORPLAN_ITEM_ICON_OVERRIDES[item.asset.id] ?? item.asset.floorPlanUrl
|
|
||||||
}
|
|
||||||
|
|
||||||
function FloorplanItemImage({
|
function FloorplanItemImage({
|
||||||
url,
|
url,
|
||||||
@@ -5283,8 +5274,7 @@ const FloorplanNodeLayer = memo(function FloorplanNodeLayer({
|
|||||||
: isHovered
|
: isHovered
|
||||||
? 0.58
|
? 0.58
|
||||||
: 0.52
|
: 0.52
|
||||||
const floorPlanUrl = getFloorplanItemIconUrl(item)
|
const floorPlanUrl = item.asset.floorPlanUrl
|
||||||
const shouldDrawFootprintBorder = !FLOORPLAN_ITEMS_WITH_SELF_OUTLINED_ICON.has(item.asset.id)
|
|
||||||
const diagonalAStart = polygon[0]
|
const diagonalAStart = polygon[0]
|
||||||
const diagonalAEnd = polygon[2]
|
const diagonalAEnd = polygon[2]
|
||||||
const diagonalBStart = polygon[1]
|
const diagonalBStart = polygon[1]
|
||||||
@@ -5368,14 +5358,9 @@ const FloorplanNodeLayer = memo(function FloorplanNodeLayer({
|
|||||||
: 0.015
|
: 0.015
|
||||||
}
|
}
|
||||||
points={points}
|
points={points}
|
||||||
stroke={shouldDrawFootprintBorder ? stroke : 'none'}
|
stroke={stroke}
|
||||||
strokeOpacity={shouldDrawFootprintBorder ? 1 : 0}
|
|
||||||
strokeWidth={
|
strokeWidth={
|
||||||
shouldDrawFootprintBorder
|
isSelectionActive ? FLOORPLAN_SELECTED_WALL_STROKE_WIDTH : FLOORPLAN_WALL_STROKE_WIDTH
|
||||||
? isSelectionActive
|
|
||||||
? FLOORPLAN_SELECTED_WALL_STROKE_WIDTH
|
|
||||||
: FLOORPLAN_WALL_STROKE_WIDTH
|
|
||||||
: 0
|
|
||||||
}
|
}
|
||||||
vectorEffect="non-scaling-stroke"
|
vectorEffect="non-scaling-stroke"
|
||||||
/>
|
/>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user