mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Refactor code style and remove mask editor examples
This commit applies consistent code style changes (mainly spacing and formatting) across multiple JS files for improved readability and maintainability. Additionally, it removes the unused 'js/examples/mask_editor_examples.js' file.
This commit is contained in:
@@ -2,7 +2,7 @@ import {saveImage, removeImage} from "./db.js";
|
||||
import {createModuleLogger} from "./utils/LoggerUtils.js";
|
||||
import {generateUUID, generateUniqueFileName} from "./utils/CommonUtils.js";
|
||||
import {withErrorHandling, createValidationError} from "./ErrorHandler.js";
|
||||
import { app, ComfyApp } from "../../scripts/app.js";
|
||||
import {app, ComfyApp} from "../../scripts/app.js";
|
||||
|
||||
const log = createModuleLogger('CanvasLayers');
|
||||
|
||||
@@ -141,7 +141,7 @@ export class CanvasLayers {
|
||||
try {
|
||||
log.info("Attempting to paste from system clipboard");
|
||||
const clipboardItems = await navigator.clipboard.read();
|
||||
|
||||
|
||||
for (const item of clipboardItems) {
|
||||
const imageType = item.types.find(type => type.startsWith('image/'));
|
||||
|
||||
@@ -160,7 +160,7 @@ export class CanvasLayers {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info("No image found in system clipboard");
|
||||
return false;
|
||||
} catch (error) {
|
||||
@@ -178,7 +178,7 @@ export class CanvasLayers {
|
||||
const imageId = generateUUID();
|
||||
await saveImage(imageId, image.src);
|
||||
this.canvas.imageCache.set(imageId, image.src);
|
||||
|
||||
|
||||
let finalWidth = image.width;
|
||||
let finalHeight = image.height;
|
||||
let finalX, finalY;
|
||||
@@ -268,7 +268,7 @@ export class CanvasLayers {
|
||||
*/
|
||||
resizeLayer(scale) {
|
||||
if (this.canvas.selectedLayers.length === 0) return;
|
||||
|
||||
|
||||
this.canvas.selectedLayers.forEach(layer => {
|
||||
layer.width *= scale;
|
||||
layer.height *= scale;
|
||||
@@ -283,7 +283,7 @@ export class CanvasLayers {
|
||||
*/
|
||||
rotateLayer(angle) {
|
||||
if (this.canvas.selectedLayers.length === 0) return;
|
||||
|
||||
|
||||
this.canvas.selectedLayers.forEach(layer => {
|
||||
layer.rotation += angle;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user