forked from Wobbl/Wobuzz
Improved comments.
This commit is contained in:
parent
f815e21aa8
commit
905f157ee0
1 changed files with 2 additions and 2 deletions
|
@ -28,8 +28,8 @@ class TrackProgressSlider(QSlider):
|
|||
|
||||
# old value calculation:
|
||||
# value = self.maximum() * x // self.width()
|
||||
# but we need that calculation because the handle width is limiting the range, and we need to set
|
||||
# the slider handle's center to the click position, not the start of the handle
|
||||
# but we need that new calculation because the handle width is limiting the range, and we need to set
|
||||
# the slider handle's center to the click position, not to the start of the handle
|
||||
# (self.width() - self.handle_width) calculates the usable width and
|
||||
# (x - self.handle_width // 2) offsets the position by minus half of the handle width
|
||||
value = self.maximum() * (x - self.handle_width // 2) // (self.width() - self.handle_width)
|
||||
|
|
Loading…
Add table
Reference in a new issue