added a fill action

This commit is contained in:
Malcolm Diller 2022-12-21 16:20:07 -08:00
parent 9d19698bf3
commit 7f36473544

View File

@ -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",