mansrz / pymt

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

MTCircularSlider with non-default max value returns incorrect value #349

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create an MTCircular Slider with a max value > 100
2.Add an on_value_changed func that prints the args value
3.change the value of the slider

What is the expected output? What do you see instead?
Expected: maximum value within the bounds
Actual: maximum value / 100 * max_value can go above the bounds
Example:
Slider_max of 150
At the maximum, _calculate_angle returns 150.
_set_value gets 150, does 150/100 * 150, which = 225
_value is set to 225 and passed to the event function

What version of the product are you using? On what operating system?
0.5.1
Windows XP

Please provide any additional information below.
My fix was to change the line in _set_value from
self._value = value / 100. * self.max
to
self._value = value

Original issue reported on code.google.com by Ghost...@gmail.com on 23 Nov 2010 at 12:42