diff --git a/js/solar/solarMQTT.js b/js/solar/solarMQTT.js index 7757e6f..7e0cea2 100644 --- a/js/solar/solarMQTT.js +++ b/js/solar/solarMQTT.js @@ -126,8 +126,14 @@ function setDisplay(id, wert) { schreibe("d:" + id, wert, s => { svgElement(i // eine eigene Compositor-Ebene an, und die kostet Speicher. function setFlowWidth(id, width) { const flow = svgElement(id); - const sichtbar = Math.abs(width) >= 0.5; - flow.style.setProperty("--w", (sichtbar ? Math.abs(width) : 0) + "px"); + // Eine negative Breite heisst "kein Fluss in dieser Richtung" - die + // Aufrufer rechnen 55*(1-exp(x)), was bei umgekehrtem Vorzeichen negativ + // wird. Frueher zeichnete eine negative stroke-width schlicht nichts. + // Math.max haelt das bei; Math.abs wuerde stattdessen einen Fluss in der + // falschen Richtung mit voller Staerke anzeigen. + const breite = Math.max(0, width); + const sichtbar = breite >= 0.5; + flow.style.setProperty("--w", breite + "px"); flow.style.animationPlayState = sichtbar ? "running" : "paused"; flow.style.willChange = sichtbar ? "transform" : "auto"; }