mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-09 04:52:32 +08:00
Update web/extensions/core/maskeditor.js
Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
This commit is contained in:
parent
4e8209f74b
commit
10240eb5c6
@ -173,28 +173,25 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
this.element.appendChild(bottom_panel);
|
this.element.appendChild(bottom_panel);
|
||||||
document.body.appendChild(brush);
|
document.body.appendChild(brush);
|
||||||
|
|
||||||
var clearButton = this.createLeftButton("Clear", "280px",
|
var brush_size_slider = this.createLeftSlider(self, "Thickness", (event) => {
|
||||||
|
self.brush_size = event.target.value;
|
||||||
|
self.updateBrushPreview(self, null, null);
|
||||||
|
});
|
||||||
|
var clearButton = this.createLeftButton("Clear",
|
||||||
() => {
|
() => {
|
||||||
self.maskCtx.clearRect(0, 0, self.maskCanvas.width, self.maskCanvas.height);
|
self.maskCtx.clearRect(0, 0, self.maskCanvas.width, self.maskCanvas.height);
|
||||||
self.backupCtx.clearRect(0, 0, self.backupCanvas.width, self.backupCanvas.height);
|
self.backupCtx.clearRect(0, 0, self.backupCanvas.width, self.backupCanvas.height);
|
||||||
});
|
});
|
||||||
|
var cancelButton = this.createRightButton("Cancel", () => {
|
||||||
var saveButton = this.createRightButton("Save", "110px", () => {
|
|
||||||
document.removeEventListener("mouseup", MaskEditorDialog.handleMouseUp);
|
|
||||||
document.removeEventListener("keydown", MaskEditorDialog.handleKeyDown);
|
|
||||||
self.save();
|
|
||||||
});
|
|
||||||
|
|
||||||
var cancelButton = this.createRightButton("Cancel", "20px", () => {
|
|
||||||
document.removeEventListener("mouseup", MaskEditorDialog.handleMouseUp);
|
document.removeEventListener("mouseup", MaskEditorDialog.handleMouseUp);
|
||||||
document.removeEventListener("keydown", MaskEditorDialog.handleKeyDown);
|
document.removeEventListener("keydown", MaskEditorDialog.handleKeyDown);
|
||||||
self.close();
|
self.close();
|
||||||
});
|
});
|
||||||
|
var saveButton = this.createRightButton("Save", () => {
|
||||||
var brush_size_slider = this.createLeftSlider(self, "Thickness", "20px", (event) => {
|
document.removeEventListener("mouseup", MaskEditorDialog.handleMouseUp);
|
||||||
self.brush_size = event.target.value;
|
document.removeEventListener("keydown", MaskEditorDialog.handleKeyDown);
|
||||||
self.updateBrushPreview(self, null, null);
|
self.save();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.element.appendChild(imgCanvas);
|
this.element.appendChild(imgCanvas);
|
||||||
this.element.appendChild(maskCanvas);
|
this.element.appendChild(maskCanvas);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user