diff --git a/web/widget_vector.js b/web/widget_vector.js index a8cbf17..8eaf8b6 100644 --- a/web/widget_vector.js +++ b/web/widget_vector.js @@ -1,6 +1,5 @@ /** * File: widget_vector.js - * Project: Jovi_GLSL */ @@ -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;