summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2020-01-11 14:18:34 +0100
committerPaweł Redman <pawel.redman@gmail.com>2020-01-11 14:18:34 +0100
commit3e4527837d64a56069e8d7021d810c7c8ac6285f (patch)
tree1b9958abbb939a2e09dda3e1fcc8b7fff23c8da5
parent86da1a17f89ee4d9b7701d4fe3a2863e1177e919 (diff)
Fix a bug that shouldn't be there
-rw-r--r--src/ui_widgets.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui_widgets.py b/src/ui_widgets.py
index 867764d..33a09a1 100644
--- a/src/ui_widgets.py
+++ b/src/ui_widgets.py
@@ -117,6 +117,12 @@ class EllipseWidget(QWidget):
P.translate(cx, cy)
P.scale(1, -1)
+ # FIXME: wtf...
+ if type(self.ellipse.alpha) is np.ndarray:
+ self.ellipse.alpha = self.ellipse.alpha[0]
+ if type(self.ellipse.theta) is np.ndarray:
+ self.ellipse.theta = self.ellipse.theta[0]
+
# radii
P.setPen(Pens.radii)
csa = np.array([np.cos(self.ellipse.alpha), np.sin(self.ellipse.alpha)])
@@ -159,9 +165,9 @@ class EllipseWidget(QWidget):
T = np.dot(np.array([[0, 1], [-1, 0]]), N)
ax = x - N * 5 + T * 5
- P.drawLine(x[0], x[1], ax[0], ax[1])
+ P.drawLine(int(x[0]), int(x[1]), int(ax[0]), int(ax[1]))
ax = x - N * 5 - T * 5
- P.drawLine(x[0], x[1], ax[0], ax[1])
+ P.drawLine(int(x[0]), int(x[1]), int(ax[0]), int(ax[1]))
path.closeSubpath()
P.drawPath(path)