Fix unexpected type 'float' labelImg in labelDialog

This commit is contained in:
tzutalin 2022-06-18 23:38:03 -07:00
parent 1c94399b91
commit eb603c29e1

View File

@ -71,7 +71,7 @@ class LabelDialog(QDialog):
self.adjustSize() self.adjustSize()
btn.adjustSize() btn.adjustSize()
offset = btn.mapToGlobal(btn.pos()) - self.pos() offset = btn.mapToGlobal(btn.pos()) - self.pos()
offset += QPoint(btn.size().width()/4, btn.size().height()/2) offset += QPoint(btn.size().width() // 4, btn.size().height() // 2)
cursor_pos.setX(max(0, cursor_pos.x() - offset.x())) cursor_pos.setX(max(0, cursor_pos.x() - offset.x()))
cursor_pos.setY(max(0, cursor_pos.y() - offset.y())) cursor_pos.setY(max(0, cursor_pos.y() - offset.y()))