Two rendering glitch fixes for time series charts 87/3287/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 26 Sep 2019 20:24:12 +0000 (23:24 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 26 Sep 2019 20:25:12 +0000 (23:25 +0300)
commit78d831a19c254d829e45d04c5ec6a3057680b7d7
treee47e9353cb9db5bb7d01c576ba5f58b725948a55
parent3a1169e5b601f99d66cadaf398329fde9cc8e14a
Two rendering glitch fixes for time series charts

1. Grid values were not rendered properly when the [yMin,yMax] interval
   gets too small (under 1e-6). The calculations in
   GridSpacing.makeGridSpacing contain a capping logic for parameter
   viewboxSize which doesn't necessarily have to be there (IMHO). The
   problem is essentially that auto-scaling the Y-axis allows zooming to
   any small value interval, but the vertical ruler rendering just
   doesn't work properly in those cases.

2. GridUtil.calcLabelWidth calculated the rendered Y-value labels
   differently from the rendering logic in GridUtil.paintVerticalRuler
   and GridUtil.paintVerticalSlaveRuler, i.e. in a more inprecise manner
   which results in the y-axis reserved width not following properly
   what is rendered.

gitlab #392

Change-Id: I30998d9336e50606956a78ad547ee437e0439f1a
bundles/org.simantics.g2d/src/org/simantics/g2d/utils/GridSpacing.java
bundles/org.simantics.g2d/src/org/simantics/g2d/utils/GridUtil.java