Fix measurement display and ruler rendering

- Add printAreaWidthMm and printAreaHeightMm to ProductDTO type
- Include these fields in toProductDTO conversion function
- Refactor ruler calculations to use simple for loops
- Rulers now display correctly showing 2cm increments on both axes
- Position & Size panel now shows accurate cm measurements

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 12:08:14 +01:00
co-authored by Claude Haiku 4.5
parent 4658b5a8b8
commit c20c696ccb
3 changed files with 70 additions and 42 deletions
+2
View File
@@ -19,6 +19,8 @@ export function toProductDTO(p: PrismaProduct, activePromotions: ActivePromotion
mockup: p.mockup,
printArea: JSON.parse(p.printArea),
printAreaBack: p.printAreaBack ? JSON.parse(p.printAreaBack) : null,
printAreaWidthMm: p.printAreaWidthMm,
printAreaHeightMm: p.printAreaHeightMm,
imageUrl: p.imageUrl,
imageUrlBack: p.imageUrlBack,
photoRecolorable: p.photoRecolorable,
+2
View File
@@ -43,6 +43,8 @@ export type ProductDTO = {
mockup: string;
printArea: PrintArea;
printAreaBack: PrintArea | null;
printAreaWidthMm: number;
printAreaHeightMm: number;
imageUrl: string | null;
imageUrlBack: string | null;
photoRecolorable: boolean;