Circular Slider in canvas

Thanks. Found the problem.

In my testing, I never changed the length, so I missed that I had hard coded the offset value in the hit test.

Change line 22 in hitTest from:

val = math.radians(self.value + 20) + math.pi / 2

to this:

val = math.radians(self.value + ((360 - self.length)/2)) + math.pi /2

That will account for a dynamic offset.

My apologies.

In testing though, I have discovered that there is now/still a bug when the length is less than 180 degrees. I will continue to try and correct that.

2 Likes