Skip to content

Commit 77fab84

Browse files
committed
* vector fields can now be reset by clicking on the header of the field
1 parent 1ac6014 commit 77fab84

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ You can colorize nodes via their `title background`, `node body` or `title text`
111111
<img src="https://github.com/user-attachments/assets/4459855c-c4e6-4739-811e-a6c90aa5a90c" alt="TICK Node Batch Support Output" width="384"/>
112112
</div>
113113

114+
**2024/02/23** @1.7.26:
115+
* vector fields can now be reset by clicking on the header of the field
116+
114117
**2024/02/22** @1.7.25:
115118
* cleanup api names
116119
* cleaned up typehints

__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
# nodes to skip on import; for online systems; skip Export, Streamreader, etc...
7676
JOV_IGNORE_NODE = ROOT / 'ignore.txt'
7777

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

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

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "jovimetrix"
33
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."
4-
version = "1.7.25"
4+
version = "1.7.26"
55
license = { file = "LICENSE" }
66
readme = "README.md"
77
authors = [{ name = "Alexander G. Morano", email = "[email protected]" }]

web/widget/widget_vector.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/**
22
* File: widget_vector.js
3-
* Project: Jovimetrix
43
*/
54

5+
66
import { app } from "../../../scripts/app.js"
7-
import { widgetToInput, widgetToWidget } from '../util/util_widget.js'
8-
import { domInnerValueChange } from '../util/util.js'
97
import { $el } from "../../../scripts/ui.js"
8+
import { widgetToInput, widgetToWidget, domInnerValueChange } from './util_jov.js'
109
/** @import { IWidget, LGraphCanvas } from '../../types/litegraph/litegraph.d.ts' */
1110

1211
function isVersionLess(v1, v2) {
@@ -164,7 +163,11 @@ const VectorWidget = (app, inputName, options, initial, desc='') => {
164163
const index = Math.floor(x / element_width);
165164

166165
pointer.onClick = (eUp) => {
167-
if (index >= 0 && index < size) {
166+
/* if click on header, reset to defaults */
167+
if (index == -1) {
168+
widget.value = Object.assign({}, widget.options.default);
169+
}
170+
else if (index >= 0 && index < size) {
168171
const pos = [eUp.canvasX - node.pos[0], eUp.canvasY - node.pos[1]]
169172
const old_value = { ...this.value };
170173
const label = this.options?.label ? this.name + '➖' + this.options.label?.[index] : this.name;

0 commit comments

Comments
 (0)