Remove CanvasLayers delegation methods from Canvas.js

Eliminated 14 delegation methods to CanvasLayers from Canvas.js. Updated all relevant calls in CanvasRenderer.js, CanvasIO.js, and CanvasInteractions.js to use canvas.canvasLayers directly. This streamlines the Canvas class to only expose core facade operations and necessary helpers.
This commit is contained in:
Dariusz L
2025-06-29 20:39:31 +02:00
parent 1bb4909438
commit 0b3bdaf769
5 changed files with 17 additions and 29 deletions

View File

@@ -374,7 +374,7 @@ export class CanvasIO {
this.canvas.height / inputImage.height * 0.8
);
const layer = await this.canvas.addLayerWithImage(image, {
const layer = await this.canvas.canvasLayers.addLayerWithImage(image, {
x: (this.canvas.width - inputImage.width * scale) / 2,
y: (this.canvas.height - inputImage.height * scale) / 2,
width: inputImage.width * scale,
@@ -744,7 +744,7 @@ export class CanvasIO {
img.src = result.image_data;
});
await this.canvas.addLayerWithImage(img, {
await this.canvas.canvasLayers.addLayerWithImage(img, {
x: 0,
y: 0,
width: this.canvas.width,