diff --git a/README.md b/README.md index c9e9870..ef9c37e 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,9 @@ Please consider sponsoring me if you enjoy the results of my work, code or docum ## UPDATES +**2024/02/18** @1.1.13: +* vector fields can now be reset by clicking on the header of the field + **2024/02/18** @1.1.12: * removed over-zealous texture hashing for matching images [issue 7](https://github.com/Amorano/Jovi_GLSL/issues/7#issuecomment-2661241411) diff --git a/pyproject.toml b/pyproject.toml index e62c33b..0adbd3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "jovi_glsl" description = "ComfyUI Nodes that integrate GLSL shader support." -version = "1.1.12" +version = "1.1.13" license = { file = "LICENSE" } readme = "README.md" authors = [{ name = "Alexander G. Morano", email = "amorano@gmail.com" }] diff --git a/web/widget_vector.js b/web/widget_vector.js index 12e7cf9..8eaf8b6 100644 --- a/web/widget_vector.js +++ b/web/widget_vector.js @@ -1,8 +1,8 @@ /** * File: widget_vector.js - * Project: Jovi_GLSL */ + import { app } from "../../../scripts/app.js" import { $el } from "../../../scripts/ui.js" import { widgetToInput, widgetToWidget, domInnerValueChange } from './util_jov.js' @@ -163,7 +163,11 @@ const VectorWidget = (app, inputName, options, initial, desc='') => { const index = Math.floor(x / element_width); pointer.onClick = (eUp) => { - if (index >= 0 && index < size) { + /* if click on header, reset to defaults */ + if (index == -1) { + widget.value = Object.assign({}, widget.options.default); + } + else if (index >= 0 && index < size) { const pos = [eUp.canvasX - node.pos[0], eUp.canvasY - node.pos[1]] const old_value = { ...this.value }; const label = this.options?.label ? this.name + '➖' + this.options.label?.[index] : this.name;