summaryrefslogtreecommitdiff
path: root/src/ui_widgets.py
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-05-02 18:30:25 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-05-02 18:30:25 +0200
commit6db078cf4696289bb40169398ebe5f3b1f5e87bb (patch)
tree19faacba467acf04a1b257e3835b0c97c8ee42d7 /src/ui_widgets.py
parentd39c23895857ef9ae8080ddd125e845eaa1c8aa3 (diff)
Transmissivity
Diffstat (limited to 'src/ui_widgets.py')
-rw-r--r--src/ui_widgets.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui_widgets.py b/src/ui_widgets.py
index 48282c4..636f2ed 100644
--- a/src/ui_widgets.py
+++ b/src/ui_widgets.py
@@ -29,8 +29,11 @@ class EllipseWidget(QWidget):
self.ellipse = None
self.is_used = True
+ self.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding, \
+ QSizePolicy.MinimumExpanding))
+
def minimumSizeHint(self):
- return QSize(150, 150)
+ return QSize(100, 100)
def paintEvent(self, event):
P = QPainter(self)
@@ -68,6 +71,10 @@ class EllipseWidget(QWidget):
if self.state is None:
return
+ if np.isnan(self.ellipse.a) or np.isnan(self.ellipse.b) \
+ or np.isnan(self.ellipse.alpha) or np.isnan(self.ellipse.theta):
+ return
+
P.resetTransform()
r *= 0.88
P.translate(cx, cy)