summaryrefslogtreecommitdiff
path: root/grc/gui/Block.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2016-08-30 16:27:31 +0200
committerSebastian Koslowski <koslowski@kit.edu>2016-09-12 12:15:00 -0600
commiteeea99b45c0a0dccd935dc5203b71e0adf1430fe (patch)
tree5cac0682d380c04ec323f98ab8f2df36e45e03bd /grc/gui/Block.py
parenteb6033357a2ca8db17c4fd2cfd6f1bf789e40330 (diff)
grc: gtk3: calculate flowgraph canvas size
Diffstat (limited to 'grc/gui/Block.py')
-rw-r--r--grc/gui/Block.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 4b6c5b8e9e..b37bec6dfa 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -311,6 +311,16 @@ class Block(CoreBlock, Element):
PangoCairo.show_layout(cr, self._comment_layout)
cr.restore()
+ @property
+ def extend(self):
+ extend = Element.extend.fget(self)
+ x, y = self.coordinate
+ for port in self.active_ports():
+ extend = (min_or_max(xy, offset + p_xy) for offset, min_or_max, xy, p_xy in zip(
+ (x, y, x, y), (min, min, max, max), extend, port.extend
+ ))
+ return tuple(extend)
+
##############################################
# Controller Modify
##############################################