Skip to content

Commit

Permalink
* vector fields can now be reset by clicking on the header of the field
Browse files Browse the repository at this point in the history
  • Loading branch information
Amorano committed Feb 23, 2025
1 parent d375d51 commit 6b208a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }]
Expand Down
8 changes: 6 additions & 2 deletions web/widget_vector.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6b208a7

Please sign in to comment.