Merge pull request #541 from justengel/image_render_error

ImageItem render error if graph is too small.
This commit is contained in:
Luke Campagnola 2018-09-28 15:38:02 -07:00 committed by GitHub
commit efaf61f711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,6 +369,11 @@ class ImageItem(GraphicsObject):
o = self.mapToDevice(QtCore.QPointF(0,0))
x = self.mapToDevice(QtCore.QPointF(1,0))
y = self.mapToDevice(QtCore.QPointF(0,1))
# Check if graphics view is too small to render anything
if o is None or x is None or y is None:
return
w = Point(x-o).length()
h = Point(y-o).length()
if w == 0 or h == 0: