halfhp / androidplot

Charts and plots for Android
http://androidplot.com
Apache License 2.0
505 stars 159 forks source link

Changing grid insets after the plot has been drawn once do not have effect #78

Closed hohteri closed 6 years ago

hohteri commented 6 years ago

Changing grid insets after the plot has been drawn once do not have effect.

After drawing the plot once // kotlin plot.clear() plot.graph.gridInsets.bottom = PixelUtils.dpToPix(40f) plot.redraw()

This is because XYGraphWidget onResize is the only place where gridInsets have an effect. This is called by Widget checkSize which guards calling resize with size of the widget rect. CheckSize is called on widget.draw() But the widget rect does not change due to gridInset being changed.

One quick fix could be to call onResize whenever gridInsets is set.

1.5.4

halfhp commented 6 years ago

Hmm very likely a regression caused by this change. Thanks for the report - will take a look.

halfhp commented 6 years ago

Fixed for the 1.5.5 release