working lib
This commit is contained in:
+6
-7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user