das-developers / das2java

The original das2 library. Provides interactive publication-ready 2-D plotting
https://das2.org
GNU Lesser General Public License v3.0
4 stars 0 forks source link

DasAxis drawn after resize called on different thread, and other mistakes #42

Open jbfaden opened 1 year ago

jbfaden commented 1 year ago

Autoplot initializes and for one paint you can see it paints the roughly 100-by-100 pixels of the canvas before properly drawing the entire canvas. This is because its size must be set on a different thread, so the axis is drawn at full height though the clip region is small. Other inconsistencies are found in the DasAxis, and as the component is resized, the axis bounds will jump around a bit. Note that everything is drawn properly after the transition, but the jumpiness and partial draws are sloppy and distracting.

jbfaden commented 1 year ago

I've put in code to ensure that the bounds were calculated with the current axis size, and return immediately when they are not. This eliminates the initial partial draw, and makes the resize less jumpy, though this is replaced by missing frames where nothing is drawn (and it flickers).