yuntaozhu / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

TwoThumbSlider fails when step is not integer #641

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. Create two thumb slider.
2. Set the step to 0.1
3. Set the extend to the maximum and start playing with the value thumb

What is the expected output? What do you see instead?
The sliders should always work. Instead there is a condition in 
setThumbPosition_ that says that:
- the sum of the value and extent from the range model should not exceed the 
maximum value
(this.getMaximum() >= end)

However due to the nature of numbers in JavaScript it is possible to get 
wrongly false value there due to rounding (so basically if we have maximum 
value 20 the end value could be calculated as 20.000000000000004).

From that point on the Value thumb does not work unless the extent thumb is 
moved to 'fix' the calculation.

What version of the product are you using? On what operating system?
latest from public git

Please provide any additional information below.

Note: we cannot accept patches without the contributor license agreement
being signed. See http://code.google.com/p/closure-
library/wiki/Contributors for more info.

Original issue reported on code.google.com by regardin...@gmail.com on 22 Apr 2014 at 12:18

GoogleCodeExporter commented 8 years ago
This project has moved: https://github.com/google/closure-library

Original comment by johnl...@google.com on 23 Jul 2015 at 7:51