fix: ImageView calling deprecated QGraphicsItem.scale()

This commit is contained in:
KIU Shueng Chuan 2021-08-14 14:01:27 +08:00
parent e752336b55
commit 11b4a1bb47

View File

@ -358,13 +358,15 @@ class ImageView(QtGui.QWidget):
profiler() profiler()
self.imageItem.resetTransform() if transform is None:
if scale is not None: transform = QtGui.QTransform()
self.imageItem.scale(*scale) # note that the order of transform is
if pos is not None: # scale followed by translate
self.imageItem.setPos(*pos) if pos is not None:
if transform is not None: transform.translate(*pos)
self.imageItem.setTransform(transform) if scale is not None:
transform.scale(*scale)
self.imageItem.setTransform(transform)
profiler() profiler()