HumanSignal / labelImg

LabelImg is now part of the Label Studio community. The popular image annotation tool created by Tzutalin is no longer actively being developed, but you can check out Label Studio, the open source data labeling tool for images, text, hypertext, audio, video and time-series data.
https://youtu.be/p0nR2YsCY_U
MIT License
22.15k stars 6.23k forks source link

Solve Type Error in `scroll_request` method #982

Open sohang3112 opened 1 year ago

sohang3112 commented 1 year ago

The following error occurs in scroll_request method:

Traceback (most recent call last):
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python311\Lib\site-packages\labelImg\labelImg.py", line 965, in scroll_request
    bar.setValue(bar.value() + bar.singleStep() * units)
TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

This is because units = - delta / (8 * 15) is a float, so bar.value() + bar.singleStep() * units is also coerced to a float. The solution is to use // (integer division) instead of /.

sohang3112 commented 11 months ago

@tzutalin Please review this pull request, and let me know if there are any issues. Thanks in advance 🙂

sohang3112 commented 10 months ago

@tzutalin Did you have a chance to review this PR yet?

sohang3112 commented 7 months ago

@tzutalin Did you have a chance to review this PR yet?