Skip to content

Commit

Permalink
Merge pull request #68 from vietanhdev/fix/crashing_on_scrolling
Browse files Browse the repository at this point in the history
Fix crashing when scrolling
  • Loading branch information
vietanhdev authored May 1, 2023
2 parents c2bd7e8 + 782be49 commit 1ded077
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions anylabeling/views/labeling/label_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ def scroll_request(self, delta, orientation):
self.set_scroll(orientation, value)

def set_scroll(self, orientation, value):
self.scroll_bars[orientation].setValue(value)
self.scroll_bars[orientation].setValue(round(value))
self.scroll_values[orientation][self.filename] = value

def set_zoom(self, value):
Expand Down Expand Up @@ -1775,8 +1775,8 @@ def zoom_request(self, delta, pos):
if canvas_width_old != canvas_width_new:
canvas_scale_factor = canvas_width_new / canvas_width_old

x_shift = round(pos.x() * canvas_scale_factor) - pos.x()
y_shift = round(pos.y() * canvas_scale_factor) - pos.y()
x_shift = round(pos.x() * canvas_scale_factor - pos.x())
y_shift = round(pos.y() * canvas_scale_factor - pos.y())

self.set_scroll(
Qt.Horizontal,
Expand Down

0 comments on commit 1ded077

Please sign in to comment.