Slider Rounding Errors?
Posted: Mon Jun 04, 2012 5:47 am
I've been trying out different sliders and noticed that when moving the thumb around the width of the left and right get miscalculated. The bar can grow and shrink or the thumb can overlap the sides incorrectly as well. It even sometimes depends on the positioning of the sliders themselves in the window!
I don't know if this can be fixed, but it's something to look out for. You can even see this bug happen in the tutorial level's preferences page. I've compiled a screenshot that shows the two bugs I'm talking about.
The first is just the bars without extra explanation, the second image is stripped down to just the slider bars and has white lines I've added in to showcase measuring discrepancies. Bar #1 is measured correctly at the native width of 192 pixels while bar #2 has the thumb moved slightly and it throws off the measurements yielding a width of 191 pixels. Bar #3 has the thumb in the right place with the left and right bars cut off at the correct widths but bar #4 has the thumb nudged 1 pixel to the left where the left and right bars are incorrectly still registering the same widths as bar #3.
I hope that makes sense, and if not I hope the images convey the problem. My speculation is a rounding error but I can't be sure what it is.
I don't know if this can be fixed, but it's something to look out for. You can even see this bug happen in the tutorial level's preferences page. I've compiled a screenshot that shows the two bugs I'm talking about.
The first is just the bars without extra explanation, the second image is stripped down to just the slider bars and has white lines I've added in to showcase measuring discrepancies. Bar #1 is measured correctly at the native width of 192 pixels while bar #2 has the thumb moved slightly and it throws off the measurements yielding a width of 191 pixels. Bar #3 has the thumb in the right place with the left and right bars cut off at the correct widths but bar #4 has the thumb nudged 1 pixel to the left where the left and right bars are incorrectly still registering the same widths as bar #3.
I hope that makes sense, and if not I hope the images convey the problem. My speculation is a rounding error but I can't be sure what it is.