File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -244,9 +244,22 @@ public void restore(final Memento memento)
244244 {
245245 memento .getString (TAG_ZOOM ).ifPresent (level ->
246246 {
247- // Simulate user input: Set value, invoke handler
248- zoom_action .setValue (level );
249- zoom_action .getOnAction ().handle (null );
247+ Platform .runLater (() -> {
248+ // Simulate user input: Set value, invoke handler
249+ //
250+ // Run this inside Platform.runLater(), since
251+ // the constructor of ZoomAction also sets the zoom-
252+ // level (to the value set by the option
253+ // 'default_zoom_factor', which by default is set
254+ // to 100%) using Platform.runLater(). When
255+ // restoring an instance of Display Runtime,
256+ // DisplayRuntime.restore() is called _after_
257+ // the constructor of ZoomAction is called and
258+ // Platform.runLater() preserves the relative
259+ // ordering of Runnables when running them.
260+ zoom_action .setValue (level );
261+ zoom_action .getOnAction ().handle (null );
262+ });
250263 });
251264 memento .getBoolean (TAG_TOOLBAR ).ifPresent (this ::showToolbar );
252265 }
You can’t perform that action at this time.
0 commit comments