Ensure new graphics content is displayed; only scale output supporting it
bug
# 1. Fix 152: Ensure new graphics content is displayed
Problem: Swing is not thread-safe, and according to internets, all changes to its state - i.e. components - need to be done on the Event Dispatch Thread. That is likely the reason why sometimes, calling `show!` did not update the already open window, or why it "flickered," showing briefly the new content than reverting to the old one.
Fix: Run all the component-changing code inside E.D.T., via `SwingUtilities/invokeAndWait`.
# 2. Fix resizing: setSize first, then setMathCmd
I have finally figured out the correct incantation to make resizing work correctly. `Show[]` has nothing to do with it. What we must do is `math.setSize` _first_ and `.setMathCommand` _second_.
Also: Factor out `ensure-math-sized-to-frame!`.
合并状态:已合并 合并于 2025-05-20 关闭于 2025-05-20 2 条评论