Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSlider track and knob disagree when Jslider minimun is non-zero #111

Open
GoogleCodeExporter opened this issue May 13, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. create a Jslider with 3 arg constrcutor where none of the args = 0
2.
3.

What is the expected output? What do you see instead?
It is expected that the track will be painted as far as the knob location.
The track is painted beyond the knob location by a distance equal to the 
minimum value.

If the minimum value is 3 and the set value is 3 the track will be painted to 6 
but the knob will be at 3.

What version of the product are you using? On what operating system? What
JRE version?

seaglass 0.2
java 1.7
windows 7

Please provide any additional information below.

Original issue reported on code.google.com by bw800...@gmail.com on 11 Nov 2014 at 3:37

@GoogleCodeExporter
Copy link
Author

I think the line in the paintValueTrack method of SliderTrackPainter class:
double percentFilled = slider.getValue() / trackLength; 
should be:
double percentFilled = (slider.getValue()-slider.getMinimum()) / trackLength; 

I haven't tested it, but I think it may solve the problem.

Original comment by bw800...@gmail.com on 11 Nov 2014 at 4:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant