# HG changeset patch # User Edouard Tisserant # Date 1651739729 -7200 # Node ID e5967a2ae2bbea158293e204c0ef498c2d06c182 # Parent a0bd2c4cb8f7688cae5bdd327e9c8dc357a81461 SVGHMI: allow widgets to disable clipping on variables given with min and max. Setting this.clip = false disables clipping. diff -r a0bd2c4cb8f7 -r e5967a2ae2bb svghmi/widgets_common.ysl2 --- a/svghmi/widgets_common.ysl2 Thu May 05 10:31:16 2022 +0200 +++ b/svghmi/widgets_common.ysl2 Thu May 05 10:35:29 2022 +0200 @@ -183,6 +183,7 @@ this.pending = indexes.map(() => undefined); this.bound_unhinibit = this.unhinibit.bind(this); this.forced_frequency = freq; + this.clip = true; } unsub(){ @@ -269,14 +270,16 @@ if(realindex == undefined) return undefined; let old_val = cache[realindex]; let new_val = eval_operation_string(old_val, opstr); - new_val = this.clip_min_max(index, new_val); + if(this.clip) + new_val = this.clip_min_max(index, new_val); return apply_hmi_value(realindex, new_val); } _apply_hmi_value(index, new_val) { let realindex = this.get_variable_index(index); if(realindex == undefined) return undefined; - new_val = this.clip_min_max(index, new_val); + if(this.clip) + new_val = this.clip_min_max(index, new_val); return apply_hmi_value(realindex, new_val); }