From 3e4527837d64a56069e8d7021d810c7c8ac6285f Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 11 Jan 2020 14:18:34 +0100 Subject: Fix a bug that shouldn't be there --- src/ui_widgets.py | 10 ++++++++-- 1 file 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) -- cgit