diff options
author | Sebastian Koslowski <sebastian.koslowski@gmail.com> | 2019-10-21 22:09:17 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-11-01 15:36:39 +0100 |
commit | 932121a62e30adb0a5c9d958e71b5756bdbd9f57 (patch) | |
tree | 0efe938b365f389e0ff1d6e0788924eeb0030daf /grc/gui/canvas/block.py | |
parent | 41095980ca9b9562b0c0b354b5a56404b91fe837 (diff) |
grc: include comments in flowgraph extent calculation (fixes #2854)
previously the extent (upper left und lower right bounding points)
only included blocks, ports and connections.
Diffstat (limited to 'grc/gui/canvas/block.py')
-rw-r--r-- | grc/gui/canvas/block.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/grc/gui/canvas/block.py b/grc/gui/canvas/block.py index 9323949c75..9810774402 100644 --- a/grc/gui/canvas/block.py +++ b/grc/gui/canvas/block.py @@ -329,6 +329,17 @@ class Block(CoreBlock, Drawable): )) return tuple(extent) + def get_extents_comment(self): + x, y = self.coordinate + if not self._comment_layout: + return x, y, x, y + if self.is_horizontal(): + y += self.height + BLOCK_LABEL_PADDING + else: + x += self.height + BLOCK_LABEL_PADDING + w, h = self._comment_layout.get_pixel_size() + return x, y, x + w, y + h + ############################################## # Controller Modify ############################################## |