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 1ac6014 commit 77fab84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ You can colorize nodes via their `title background`, `node body` or `title text`
<img src="https://github.com/user-attachments/assets/4459855c-c4e6-4739-811e-a6c90aa5a90c" alt="TICK Node Batch Support Output" width="384"/>
</div>

**2024/02/23** @1.7.26:
* vector fields can now be reset by clicking on the header of the field

**2024/02/22** @1.7.25:
* cleanup api names
* cleaned up typehints
Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
# nodes to skip on import; for online systems; skip Export, Streamreader, etc...
JOV_IGNORE_NODE = ROOT / 'ignore.txt'

JOV_LOG_LEVEL = os.getenv("JOV_LOG_LEVEL", "INFO")
logger.configure(handlers=[{"sink": sys.stdout, "level": JOV_LOG_LEVEL}])
logger.add(sys.stdout, level=os.getenv("JOV_LOG_LEVEL", "INFO"),
filter=lambda record: "jovi" in record["extra"])

JOV_INTERNAL = os.getenv("JOV_INTERNAL", 'false').strip().lower() in ('true', '1', 't')

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 = "jovimetrix"
description = "Integrates Webcam, MIDI, Spout and GLSL shader support. Animation via tick. Parameter manipulation with wave generator. Math operations with Unary and Binary support. Value conversion for all major types (int, string, list, dict, Image, Mask). Shape mask generation, image stacking and channel ops, batch splitting, merging and randomizing, load images and video from anywhere, dynamic bus routing with a single node, export support for GIPHY, save output anywhere! flatten, crop, transform; check colorblindness, make stereogram or stereoscopic images, or liner interpolate values and more."
version = "1.7.25"
version = "1.7.26"
license = { file = "LICENSE" }
readme = "README.md"
authors = [{ name = "Alexander G. Morano", email = "[email protected]" }]
Expand Down
11 changes: 7 additions & 4 deletions web/widget/widget_vector.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* File: widget_vector.js
* Project: Jovimetrix
*/


import { app } from "../../../scripts/app.js"
import { widgetToInput, widgetToWidget } from '../util/util_widget.js'
import { domInnerValueChange } from '../util/util.js'
import { $el } from "../../../scripts/ui.js"
import { widgetToInput, widgetToWidget, domInnerValueChange } from './util_jov.js'
/** @import { IWidget, LGraphCanvas } from '../../types/litegraph/litegraph.d.ts' */

function isVersionLess(v1, v2) {
Expand Down Expand Up @@ -164,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 77fab84

Please sign in to comment.