import{isEmpty}from"../../base/helpers.mjs";import{NodeView}from"../base.mjs";class ImageEditorNodeView extends NodeView{static nodeTypeName="Base";static canFlipHeader=!0;static minHeight=64;static minWidth=64;static snapSize=8;static padding=8;static edgeHandlerTolerance=8;static closeText="Remove";static nodeButtons={nodeToCanvas:{icon:"fa-solid fa-maximize",tooltip:"Scale to Canvas Size",shortcut:"z",callback:function(){this.scaleToCanvasSize()}},canvasToNode:{icon:"fa-solid fa-minimize",tooltip:"Scale Canvas to Image Size",shortcut:"g",callback:function(){this.scaleCanvasToSize()}}};async getCanvasScaleSize(){return[this.width-2*this.constructor.padding,this.height-2*this.constructor.padding]}async scaleToCanvasSize(){this.setDimension(-this.constructor.padding,-this.constructor.padding,this.editor.width+2*this.constructor.padding,this.editor.height+2*this.constructor.padding,!0)}async scaleCanvasToSize(){let[t,i]=await this.getCanvasScaleSize();this.editor.setDimension(t,i,!0,!0),this.setDimension(-this.constructor.padding,-this.constructor.padding,t+2*this.constructor.padding,i+2*this.constructor.padding,!0)}}export{ImageEditorNodeView};
