mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Increase logging level to DEBUG and enhance MaskTool callbacks
Set logging level to DEBUG in both Python and JavaScript loggers for improved debugging. Updated MaskTool to accept an onStateChange callback and trigger it after mask state changes, allowing Canvas to respond to mask updates.
This commit is contained in:
@@ -3,9 +3,10 @@ import {createModuleLogger} from "./utils/LoggerUtils.js";
|
||||
const log = createModuleLogger('Mask_tool');
|
||||
|
||||
export class MaskTool {
|
||||
constructor(canvasInstance) {
|
||||
constructor(canvasInstance, callbacks = {}) {
|
||||
this.canvasInstance = canvasInstance;
|
||||
this.mainCanvas = canvasInstance.canvas;
|
||||
this.onStateChange = callbacks.onStateChange || null;
|
||||
this.maskCanvas = document.createElement('canvas');
|
||||
this.maskCtx = this.maskCanvas.getContext('2d');
|
||||
|
||||
@@ -88,6 +89,9 @@ export class MaskTool {
|
||||
if (this.canvasInstance.canvasState) {
|
||||
this.canvasInstance.canvasState.saveMaskState();
|
||||
}
|
||||
if (this.onStateChange) {
|
||||
this.onStateChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user