dnithya90 / widgets4androidhmi

Automatically exported from code.google.com/p/widgets4androidhmi
Other
0 stars 0 forks source link

Incorrect "degreesPerNotch" culculation. #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set atswidget:totalNotches="40", for example

What is the expected output? What do you see instead?
degreesPerNotch calculated as 360/120 = 3, instead of 360/40=9.

What version of the product are you using? 
2ce8226aedb4653e74300acad50379bc009c4320

Please provide any additional information below.
We can recalculate "degreesPerNotch" in init() method.

Original issue reported on code.google.com by kapustin...@gmail.com on 14 Nov 2011 at 10:59

GoogleCodeExporter commented 9 years ago
This should do it:

Remove the following from the fixed values section:
private final float degreesPerNotch = 360.0f/totalNotches;

Add the following to the end of the notches section:
private float degreesPerNotch = 360.0f/totalNotches;

Add the following to the calculation section of the init() method:
degreesPerNotch = 360.0f/totalNotches;

Original comment by BradTWe...@gmail.com on 29 Jul 2015 at 2:40