You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
ttkbootstrap Version 1.10.1
The unexpected behaviour is that we got negative numbers and larger numbers than the "maximum limit", this happens when we are binding the mouse wheel to "step" method.
First of all, if we put positive numbers in step, we are decreasing at the beginning and when we reach the 0, it starts increasing, which it is not expected, I mean at the beginning if we are using positive numbers in "step" we should increase not decrease, and after we reach 100, now we should decrease the number.
Also, when we got 100, and we start to decrease the number with positive numbers, and suddenly we change the "step" to a negative number, we can increase larger numbers than 100, which is an annoying bug.
I got a positive delta:
And we decrease instead of increasing (in the documentation says the opposite)
We got zero if we continue giving positive numbers
Now increasing with positive numbers
Now we are going to change to negative numbers (decreasing)
We continue giving negative numbers
Here it is the bug, we shouldn't decrease more than zero.
Similar logic with the greater numbers than 100.
This is the thing.
Describe the solution you'd like
I would like that the maximum number is "maximum" and then not to have greater numbers, and I don't want to get negative numbers infinitely. And also if I use a positive number in step I want to increase, not to decrease if I haven't reached the "maximum" number
Describe alternatives you've considered
I have improved the code to have the expected behaviour.
amountused = self.amountusedvar.get()
amounttotal = self.amounttotalvar.get()
if (amountused >= amounttotal and delta > 0) or (amountused <= 0 and delta < 0):
self._towardsmaximum = False
self.amountusedvar.set(amountused - delta)
elif (amountused <= 0 and delta>0) or (amountused >= amounttotal and delta<0):
self._towardsmaximum = True
self.amountusedvar.set(amountused + delta)
elif self._towardsmaximum:
self.amountusedvar.set(amountused + delta)
else:
self.amountusedvar.set(amountused - delta)
Results
Giving positive numbers.
Increasing as expected
We reach 100
We continue with positive delta, and we got that we are decreasing as expected.
Now we are going to give negative numbers and we are increasing the amountused
We reached 100 again but with negative numbers.
We continue giving negative numbers and now it is decreasing as expected.
In similar way on the other side.
Additional context
Now the numbers are in the limits in this case 0 and 100. Maybe, a good improvement it would be to add the option of "minimum" if someone needs negative numbers not to be restricted to 0.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
ttkbootstrap Version 1.10.1
The unexpected behaviour is that we got negative numbers and larger numbers than the "maximum limit", this happens when we are binding the mouse wheel to "step" method.
First of all, if we put positive numbers in step, we are decreasing at the beginning and when we reach the 0, it starts increasing, which it is not expected, I mean at the beginning if we are using positive numbers in "step" we should increase not decrease, and after we reach 100, now we should decrease the number.
Also, when we got 100, and we start to decrease the number with positive numbers, and suddenly we change the "step" to a negative number, we can increase larger numbers than 100, which is an annoying bug.
Here it is my code:
This when we run the code
I got a positive delta:
And we decrease instead of increasing (in the documentation says the opposite)
We got zero if we continue giving positive numbers
Now increasing with positive numbers
Now we are going to change to negative numbers (decreasing)
We continue giving negative numbers
Here it is the bug, we shouldn't decrease more than zero.
Similar logic with the greater numbers than 100.
This is the thing.
Describe the solution you'd like
I would like that the maximum number is "maximum" and then not to have greater numbers, and I don't want to get negative numbers infinitely. And also if I use a positive number in step I want to increase, not to decrease if I haven't reached the "maximum" number
Describe alternatives you've considered
I have improved the code to have the expected behaviour.
We just need to change the conditions a little.
Before
After
Results
Giving positive numbers.
Increasing as expected
We reach 100
We continue with positive delta, and we got that we are decreasing as expected.
Now we are going to give negative numbers and we are increasing the amountused
We reached 100 again but with negative numbers.
We continue giving negative numbers and now it is decreasing as expected.
In similar way on the other side.
Additional context
Now the numbers are in the limits in this case 0 and 100. Maybe, a good improvement it would be to add the option of "minimum" if someone needs negative numbers not to be restricted to 0.
The text was updated successfully, but these errors were encountered: