Skip to content

Commit 1ded077

Browse files
authored
Merge pull request #68 from vietanhdev/fix/crashing_on_scrolling
Fix crashing when scrolling
2 parents c2bd7e8 + 782be49 commit 1ded077

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

anylabeling/views/labeling/label_widget.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ def scroll_request(self, delta, orientation):
17461746
self.set_scroll(orientation, value)
17471747

17481748
def set_scroll(self, orientation, value):
1749-
self.scroll_bars[orientation].setValue(value)
1749+
self.scroll_bars[orientation].setValue(round(value))
17501750
self.scroll_values[orientation][self.filename] = value
17511751

17521752
def set_zoom(self, value):
@@ -1775,8 +1775,8 @@ def zoom_request(self, delta, pos):
17751775
if canvas_width_old != canvas_width_new:
17761776
canvas_scale_factor = canvas_width_new / canvas_width_old
17771777

1778-
x_shift = round(pos.x() * canvas_scale_factor) - pos.x()
1779-
y_shift = round(pos.y() * canvas_scale_factor) - pos.y()
1778+
x_shift = round(pos.x() * canvas_scale_factor - pos.x())
1779+
y_shift = round(pos.y() * canvas_scale_factor - pos.y())
17801780

17811781
self.set_scroll(
17821782
Qt.Horizontal,

0 commit comments

Comments
 (0)