commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/05: grc: align block sizes to grid


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/05: grc: align block sizes to grid
Date: Thu, 28 Apr 2016 00:13:12 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit ec7ef7fe2942bf73e7ff9166530d25dd605a1fce
Author: Sebastian Koslowski <address@hidden>
Date:   Wed Apr 27 13:15:11 2016 +0200

    grc: align block sizes to grid
---
 grc/gui/Block.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 9513531..815982c 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -242,14 +242,15 @@ class Block(Element, _Block):
             self.vertical_label = self.get_parent().new_pixmap(height, width)
             Utils.rotate_pixmap(gc, self.horizontal_label, self.vertical_label)
         #calculate width and height needed
-        self.W = self.label_width + 2 * BLOCK_LABEL_PADDING
+        W = self.label_width + 2 * BLOCK_LABEL_PADDING
 
         def get_min_height_for_ports():
             visible_ports = filter(lambda p: not p.get_hide(), ports)
-            H = 2*PORT_BORDER_SEPARATION + len(visible_ports) * PORT_SEPARATION
-            if visible_ports: H -= ports[0].H
-            return H
-        self.H = max(
+            min_height = 2*PORT_BORDER_SEPARATION + len(visible_ports) * 
PORT_SEPARATION
+            if visible_ports:
+                min_height -= ports[0].H
+            return min_height
+        H = max(
             [  # labels
                 self.label_height + 2 * BLOCK_LABEL_PADDING
             ] +
@@ -262,6 +263,7 @@ class Block(Element, _Block):
                 for ports in (self.get_sources_gui(), self.get_sinks_gui())
             ]
         )
+        self.W, self.H = Utils.align_to_grid((W, H))
         self.has_busses = [
             any(port.get_type() == 'bus' for port in ports)
             for ports in (self.get_sources_gui(), self.get_sinks_gui())



reply via email to

[Prev in Thread] Current Thread [Next in Thread]