Refactor output area bounds handling for custom shapes

Output area bounds are now positioned relative to the world, not always at (0,0), and are updated to match custom shape placement. Rendering and extension logic have been updated to respect the new bounds, and the mask tool now adjusts to the output area position. Also sets log level to DEBUG for development.
This commit is contained in:
Dariusz L
2025-07-26 21:20:18 +02:00
parent ca9e1890c4
commit f329a6ded5
7 changed files with 90 additions and 98 deletions

View File

@@ -272,10 +272,12 @@ export class CanvasRenderer {
ctx.lineWidth = 2 / this.canvas.viewport.zoom;
ctx.setLineDash([]);
const shape = this.canvas.outputAreaShape;
const bounds = this.canvas.outputAreaBounds;
ctx.beginPath();
ctx.moveTo(shape.points[0].x, shape.points[0].y);
// Render custom shape relative to outputAreaBounds, not (0,0)
ctx.moveTo(bounds.x + shape.points[0].x, bounds.y + shape.points[0].y);
for (let i = 1; i < shape.points.length; i++) {
ctx.lineTo(shape.points[i].x, shape.points[i].y);
ctx.lineTo(bounds.x + shape.points[i].x, bounds.y + shape.points[i].y);
}
ctx.closePath();
ctx.stroke();