Fix: Pass product prop to PrintSurface for ruler calculations

- Add product parameter to PrintSurface component props
- Pass product to both front and back PrintSurface calls
- Allows rulers to access product.printAreaWidthMm for cm calculations
- Fixes ReferenceError: product is not defined

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 11:54:05 +01:00
co-authored by Claude Haiku 4.5
parent 11a9305bce
commit 4658b5a8b8
+4
View File
@@ -167,6 +167,7 @@ function PrintSurface({
caption,
onNodeReady,
scale,
product,
}: {
photo: React.ReactNode;
printArea: PrintArea;
@@ -181,6 +182,7 @@ function PrintSurface({
caption: string;
onNodeReady: () => void;
scale: number;
product: ProductDTO;
}) {
const stageW = printArea.wPct * DISPLAY;
const stageH = printArea.hPct * DISPLAY;
@@ -721,6 +723,7 @@ export default function DesignCanvas({ product }: { product: ProductDTO }) {
caption="Dashed line marks the print area"
onNodeReady={() => setNodeReadyTick((t) => t + 1)}
scale={canvasScale}
product={product}
/>
{hasBack && (
@@ -738,6 +741,7 @@ export default function DesignCanvas({ product }: { product: ProductDTO }) {
caption="Dashed line marks the print area (back)"
onNodeReady={() => setNodeReadyTick((t) => t + 1)}
scale={canvasScale}
product={product}
/>
)}
</>