merlinvn / controlp5

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

Slider with FLEXIBLE mode OR enabled tick marks can be set at the right value #43

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the attached code
2. Moving hours slider copy value to global slider ok
3. Moving global slider don't copy actual value to hours slider

What is the expected output? What do you see instead?
Moving global slider should put the same value in hours slider

What version of the product are you using? On what operating system?
Processing 2.05a, Windows 7 x64, Java 1.6

Please provide any additional information below.
Not enabling tickMarks OR FLEXIBLE mode make things work as expected. Seems 
some kind of rounding problem.

Original issue reported on code.google.com by juan.man...@gmail.com on 23 Apr 2012 at 4:13

Attachments:

GoogleCodeExporter commented 8 years ago
the rounding error persists in flexible mode as well. in addition, the tick 
marks do not extend the width of the slider.

cp5.addSlider("timerTickBar")
  .setPosition(45, 700)
  .setWidth(720)
  .setRange(50/1000.0, 120000/1000.0)
  .setValue(5000.0/1000.0)
  .setNumberOfTickMarks(240)
  .setSliderMode(Slider.FLEXIBLE);

Original comment by thinct...@gmail.com on 10 Jan 2014 at 11:02