diff --git a/src/app/api/orders/[id]/design-spec/route.ts b/src/app/api/orders/[id]/design-spec/route.ts index 289bf55..bdfb0bb 100644 --- a/src/app/api/orders/[id]/design-spec/route.ts +++ b/src/app/api/orders/[id]/design-spec/route.ts @@ -94,28 +94,26 @@ export async function GET(req: Request, { params }: { params: { id: string } }) X (0cm) Y (0cm) - + ${designElements.map((el, idx) => { const elWidth = el.width || 58; const elHeight = el.height || 58; const elCenterX = el.x + elWidth / 2; const elCenterY = el.y + elHeight / 2; - const distFromLeftCm = elCenterX * cmPerPx; - const distFromTopCm = elCenterY * cmPerPx; - const distFromLeftInches = (distFromLeftCm / 2.54).toFixed(2); - const distFromTopInches = (distFromTopCm / 2.54).toFixed(2); + const distToTopCm = elCenterY * cmPerPx; + const distToRightCm = (DISPLAY - elCenterX) * cmPerPx; + const distToTopInches = (distToTopCm / 2.54).toFixed(2); + const distToRightInches = (distToRightCm / 2.54).toFixed(2); return ` - - - - - ${distFromLeftInches}" + + + + T: ${distToTopInches}" - - - - - ${distFromTopInches}" + + + + R: ${distToRightInches}"