working lib

This commit is contained in:
Martin Fuchs
2026-08-16 13:50:49 +02:00
parent 5ca9b99df8
commit 0a0b8b19dc
3 changed files with 13 additions and 16 deletions
+6 -7
View File
@@ -929,15 +929,14 @@ class WallPlotter {
line(tl.x, 0, br.x, 0);
line(0, tl.y, 0, br.y);
// Size labels in cm along bottom and right edges
// Size labels in cm + screen pixels along bottom and right edges
const widthCm = (bounds.xMax - bounds.xMin) / 10;
const heightCm = (bounds.yMax - bounds.yMin) / 10;
const widthLabel = Number.isInteger(widthCm)
? `${widthCm} cm`
: `${widthCm.toFixed(1)} cm`;
const heightLabel = Number.isInteger(heightCm)
? `${heightCm} cm`
: `${heightCm.toFixed(1)} cm`;
const widthPx = Math.round(Math.abs(w));
const heightPx = Math.round(Math.abs(h));
const fmtCm = (cm) => (Number.isInteger(cm) ? `${cm}` : cm.toFixed(1));
const widthLabel = `${fmtCm(widthCm)} cm · ${widthPx} px`;
const heightLabel = `${fmtCm(heightCm)} cm · ${heightPx} px`;
noStroke();
fill(bounds.preview ? 140 : 160);
textFont('monospace', 12);