Slider Rounding Errors?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
Code
Newbie
Posts: 2
Joined: Mon Jun 04, 2012 5:16 am
Contact:

Slider Rounding Errors?

#1 Post by Code »

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.
Screenshot of the sliders.
Screenshot of the sliders.
Compare.png (16.64 KiB) Viewed 1152 times
Detail of the sliders with measurements.
Detail of the sliders with measurements.
Compare_detail.png (9.05 KiB) Viewed 1152 times

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Slider Rounding Errors?

#2 Post by PyTom »

I will look into this.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Code
Newbie
Posts: 2
Joined: Mon Jun 04, 2012 5:16 am
Contact:

Re: Slider Rounding Errors?

#3 Post by Code »

Oh, and this is in Ren'Py 6.13.12.1728 (the latest?) in case that matters.

Thanks for looking into it! :D

User avatar
SleepKirby
Veteran
Posts: 255
Joined: Mon Aug 09, 2010 10:02 pm
Projects: Eastern Starlight Romance, Touhou Mecha
Organization: Dai-Sukima Dan
Location: California, USA
Contact:

Re: Slider Rounding Errors?

#4 Post by SleepKirby »

I've also observed this bar issue in both of the games I'm working on. In one case, I just made the slider "slot" (the dark blue line, in the Tutorial's case) part of another element instead of part of the bar itself. So I guess that would be the workaround until there is a fix.

Post Reply

Who is online

Users browsing this forum: No registered users