* vector fields can now be reset by clicking on the header of the field
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user