# HG changeset patch # User Edouard Tisserant # Date 1662976612 -7200 # Node ID 1bd8e077894e5ad47cae310ec9f0e20492c899b9 # Parent 26a2808038fd183d89c6caa35a779c5e847d6fde SVGHMI: re-arrange Animate and data Dispath code paths. diff -r 26a2808038fd -r 1bd8e077894e svghmi/svghmi.js --- a/svghmi/svghmi.js Fri Sep 09 10:34:23 2022 +0200 +++ b/svghmi/svghmi.js Mon Sep 12 11:56:52 2022 +0200 @@ -92,7 +92,6 @@ if(jumps_need_update) update_jumps(); - apply_updates(); pending_widget_animates.forEach(widget => widget._animate()); pending_widget_animates = []; @@ -139,8 +138,9 @@ throw new Error("Unknown index "+index); } }; + + apply_updates(); // register for rendering on next frame, since there are updates - requestHMIAnimation(); } catch(err) { // 1003 is for "Unsupported Data" // ws.close(1003, err.message); @@ -348,14 +348,13 @@ function send_hmi_value(index, value) { if(index > last_remote_index){ - updates.set(index, value); + dispatch_value(index, value); if(persistent_indexes.has(index)){ let varname = persistent_indexes.get(index); document.cookie = varname+"="+value+"; max-age=3153600000"; } - requestHMIAnimation(); return; }