From eeea99b45c0a0dccd935dc5203b71e0adf1430fe Mon Sep 17 00:00:00 2001
From: Sebastian Koslowski <koslowski@kit.edu>
Date: Tue, 30 Aug 2016 16:27:31 +0200
Subject: grc: gtk3: calculate flowgraph canvas size

---
 grc/gui/Element.py | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'grc/gui/Element.py')

diff --git a/grc/gui/Element.py b/grc/gui/Element.py
index 8418bef0cc..17cd6ddd92 100644
--- a/grc/gui/Element.py
+++ b/grc/gui/Element.py
@@ -168,6 +168,15 @@ class Element(object):
                 if x <= x1 <= x_m and y <= y1 <= y_m:
                     return self
 
+    @property
+    def extend(self):
+        x_min, y_min = x_max, y_max = self.coordinate
+        x_min += min(x for x, y in self._bounding_points)
+        y_min += min(y for x, y in self._bounding_points)
+        x_max += max(x for x, y in self._bounding_points)
+        y_max += max(y for x, y in self._bounding_points)
+        return x_min, y_min, x_max, y_max
+
     def mouse_over(self):
         pass
 
-- 
cgit v1.2.3