HanSolo / SteelSeries-Canvas

The HTML5 Canvas port of the SteelSeries component library. Mainly contains gauges.
120 stars 76 forks source link

Very first setValueAnimated() invalidates min/max values. #14

Open java-artisan opened 10 years ago

java-artisan commented 10 years ago

When using a dial with min- & max indicators, the minimum value is set from here the animation started. Which is wrong because such a value never was passed to the gauge.

mcrossley commented 10 years ago

This is how it is currently implemented. The min/max indicators are designed to take their values from the value supplied to the gauge. I know that typically when you first draw the gauge you may animate it up from a 'zero' value to the current value. In this case what I do is use the animation complete callback feature of .setValueAnimated() to enable the minimum pointer and set its value after the initial animation.