mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-24 22:12:17 -03:00
Add 'fit on add' option for image placement
Introduces a 'fit_on_add' boolean option to control whether images are fit to the canvas when added or pasted. Updates image addition and paste logic in Canvas, CanvasLayers, and CanvasView to support new placement modes ('fit', 'center', 'mouse', 'default').
This commit is contained in:
12
js/Canvas.js
12
js/Canvas.js
@@ -157,8 +157,8 @@ export class Canvas {
|
||||
return this.canvasLayers.pasteLayers();
|
||||
}
|
||||
|
||||
async handlePaste(pasteMode) {
|
||||
return this.canvasLayers.handlePaste(pasteMode);
|
||||
async handlePaste(addMode) {
|
||||
return this.canvasLayers.handlePaste(addMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -194,13 +194,13 @@ export class Canvas {
|
||||
return this.canvasLayers.isRotationHandle(x, y);
|
||||
}
|
||||
|
||||
async addLayerWithImage(image, layerProps = {}) {
|
||||
return this.canvasLayers.addLayerWithImage(image, layerProps);
|
||||
async addLayerWithImage(image, layerProps = {}, addMode = 'default') {
|
||||
return this.canvasLayers.addLayerWithImage(image, layerProps, addMode);
|
||||
}
|
||||
|
||||
|
||||
async addLayer(image) {
|
||||
return this.addLayerWithImage(image);
|
||||
async addLayer(image, addMode = 'default') {
|
||||
return this.addLayerWithImage(image, {}, addMode);
|
||||
}
|
||||
|
||||
async removeLayer(index) {
|
||||
|
||||
Reference in New Issue
Block a user