mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user