Merge pull request #1567 from ksunden/inf_line_0d

Handle case of 0-d array in infinite line setPos
This commit is contained in:
Ogi Moore 2021-02-10 12:29:28 -08:00 committed by GitHub
commit 87b03b5a2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,7 @@ class InfiniteLine(GraphicsObject):
def setPos(self, pos):
if type(pos) in [list, tuple, np.ndarray]:
if isinstance(pos, (list, tuple, np.ndarray)) and not np.ndim(pos) == 0:
newPos = list(pos)
elif isinstance(pos, QtCore.QPointF):
newPos = [pos.x(), pos.y()]