From 2fb182e7ff1a778f0b5a8573caa62c06d00bb02b Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 16 Jan 2023 00:07:05 +0100 Subject: [PATCH] Timeline: analyse and fix re-entrance problem in DisplayEvaluation Note: the actual root cause, why this re-entrance happens, is due to another obvious numerics bug not yet solved. Here, the canvas width was suddenly set to zero, causing the scrollbar position to change and thus the ZoomWindow to re-fire the structure change signal. However, such invalidation of previously established baseline values can never be totally excluded in advanced layout calculations, and thus the evaluation mechanism must be prepared and re-triggered to start over, until a stable layout is achieved. --- src/stage/timeline/body-canvas-widget.cpp | 8 +- wiki/thinkPad.ichthyo.mm | 165 ++++++++++++++++++++++ 2 files changed, 171 insertions(+), 2 deletions(-) diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index f067ca301..b6aaaf429 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -117,6 +117,9 @@ namespace timeline { void setupAdditionalTrackPadding_fromCSS() { + static bool styleSetupDone{false}; + if (styleSetupDone) return; + StyleC styleRuler{trackRulerStyle.getAdvice()}; StyleC styleBody {trackBodyStyle.getAdvice()}; @@ -149,6 +152,7 @@ namespace timeline { styleBody->remove_class (slopeClassName(depth)); // styleBody->context_restore(); // <<<---does not work... } + styleSetupDone = true; } @@ -505,12 +509,12 @@ namespace timeline { void BodyCanvasWidget::maybeRebuildLayout() { - if (rootBody_ and isnil (profile_)) + while (rootBody_ and isnil (profile_)) { setupAdditionalTrackPadding_fromCSS(); layout_.triggerDisplayEvaluation(); - ENSURE (not isnil (profile_), "DisplayEvaluation logic broken"); } + ENSURE (not isnil (profile_), "DisplayEvaluation logic broken"); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index c50988b3c..7ee716d4c 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -43506,6 +43506,7 @@ + @@ -43711,6 +43712,170 @@ + + + + + + +

+ 0000001086: POSTCONDITION: body-canvas-widget.cpp:512: worker_3: maybeRebuildLayout: (not isnil (profile_)) DisplayEvaluation logic broken +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ adjust (rulerCanvas_, canvasWidth ≔0, rulerHeight ≔11✔) +

+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

+ scrollPos ⟿ zoomWindow geändert, nachdem das Profil aufgebaut wurde +

+ +
+ + + + + + +

+ ...denn den pixSpan sollte sich ja grade eben nicht ändern, sondern nur der sichtbare Fenster-Ausschnitt; die Implementierung mit dem ZoomWindow zielt ja genau darauf, die Metrik konstant zu halten, selbst wenn sich das sichtbare Fenster (wie hier) ändert +

+ +
+ +
+ + + + + + + + + +

+ und nur das kann man vom Design her einfordern (daß sie sich stabilisiert und nicht in Oszillationen gerät) +

+ +
+
+
+ + + +
+ + + + + + + + + +
+