From 0c5cfdf101b7c953af74903e1a5d878a3a095444 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 17 Jul 2026 01:45:32 +0100 Subject: [PATCH] Lower rotated inventory footprints --- packages/eve-browser-lowering/dist/index.js | 10 ++++++++-- packages/eve-browser-lowering/src/index.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/eve-browser-lowering/dist/index.js b/packages/eve-browser-lowering/dist/index.js index ec03ee8..5f9d6c4 100644 --- a/packages/eve-browser-lowering/dist/index.js +++ b/packages/eve-browser-lowering/dist/index.js @@ -1025,8 +1025,14 @@ function renderInventoryItem(node, props, layout, style, options) { event.dataTransfer.effectAllowed = "move"; event.dataTransfer.setData("application/vnd.gamecult.eve.inventory-item+json", JSON.stringify(props)); }); - item.style.gridColumn = String(x + 1); - item.style.gridRow = String(y + 1); + let widthCells = positiveInt(props.shapeWidth, 1); + let heightCells = positiveInt(props.shapeHeight, 1); + const rotation = firstString(props.rotation, "").toLowerCase(); + if (["clockwise", "counterclockwise", "right", "left", "rotate90", "rotate270"].includes(rotation)) { + [widthCells, heightCells] = [heightCells, widthCells]; + } + item.style.gridColumn = `${x + 1} / span ${widthCells}`; + item.style.gridRow = `${y + 1} / span ${heightCells}`; const icon = el("span", "cultui-inventory-item-icon"); applyGeneratedLayout(icon, prefixedProps(layout, "icon."), prefixedProps(style, "icon.")); icon.textContent = inventoryItemGlyph(firstString(props.iconAssetUri, props.iconAssetKey, props.itemKey, props.label, "")); diff --git a/packages/eve-browser-lowering/src/index.ts b/packages/eve-browser-lowering/src/index.ts index 4a104a0..c4cb66b 100644 --- a/packages/eve-browser-lowering/src/index.ts +++ b/packages/eve-browser-lowering/src/index.ts @@ -1218,8 +1218,14 @@ function renderInventoryItem( JSON.stringify(props), ); }); - item.style.gridColumn = String(x + 1); - item.style.gridRow = String(y + 1); + let widthCells = positiveInt(props.shapeWidth, 1); + let heightCells = positiveInt(props.shapeHeight, 1); + const rotation = firstString(props.rotation, "").toLowerCase(); + if (["clockwise", "counterclockwise", "right", "left", "rotate90", "rotate270"].includes(rotation)) { + [widthCells, heightCells] = [heightCells, widthCells]; + } + item.style.gridColumn = `${x + 1} / span ${widthCells}`; + item.style.gridRow = `${y + 1} / span ${heightCells}`; const icon = el("span", "cultui-inventory-item-icon"); applyGeneratedLayout(icon, prefixedProps(layout, "icon."), prefixedProps(style, "icon.")); icon.textContent = inventoryItemGlyph(firstString(props.iconAssetUri, props.iconAssetKey, props.itemKey, props.label, ""));