From 7f364735448722e445b9d805444561b41ca7debe Mon Sep 17 00:00:00 2001 From: Malcolm Diller Date: Wed, 21 Dec 2022 16:20:07 -0800 Subject: [PATCH] added a fill action --- ui/media/js/image-editor.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/media/js/image-editor.js b/ui/media/js/image-editor.js index d26b0bad..aeb7115b 100644 --- a/ui/media/js/image-editor.js +++ b/ui/media/js/image-editor.js @@ -99,6 +99,18 @@ const IMAGE_EDITOR_TOOLS = [ ] const IMAGE_EDITOR_ACTIONS = [ + { + id: "fill", + name: "Fill", + icon: "fa-solid fa-fill-drip", + handler: (editor) => { + editor.ctx_current.globalCompositeOperation = "source-over" + editor.ctx_current.rect(0, 0, editor.width, editor.height) + editor.ctx_current.fill() + editor.setBrush() + }, + trackHistory: true + }, { id: "clear", name: "Clear",