commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 02/16: grc: pad comment boxes like blocks


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/16: grc: pad comment boxes like blocks
Date: Sat, 3 Oct 2015 19:14:11 +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 e7b408195e7ee58c3983e64d44b844f8332a05cd
Author: Sebastian Koslowski <address@hidden>
Date:   Fri Sep 25 13:48:50 2015 +0200

    grc: pad comment boxes like blocks
---
 grc/gui/Block.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 94ed580..7350e4b 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -241,14 +241,17 @@ class Block(Element):
                                                complexity=complexity,
                                                font=BLOCK_FONT))
 
-        # Setup the pixel map. Make sure that layout is valid
+        # Setup the pixel map. Make sure that layout not empty
         width, height = layout.get_pixel_size()
-        if layout and width > 0 and height > 0:
-            pixmap = self.get_parent().new_pixmap(width, height)
+        if width and height:
+            padding = BLOCK_LABEL_PADDING
+            pixmap = self.get_parent().new_pixmap(width + 2 * padding,
+                                                  height + 2 * padding)
             gc = pixmap.new_gc()
             gc.set_foreground(Colors.COMMENT_BACKGROUND_COLOR)
-            pixmap.draw_rectangle(gc, True, 0, 0, width, height)
-            pixmap.draw_layout(gc, 0, 0, layout)
+            pixmap.draw_rectangle(
+                gc, True, 0, 0, width + 2 * padding, height + 2 * padding)
+            pixmap.draw_layout(gc, padding, padding, layout)
             self._comment_pixmap = pixmap
         else:
             self._comment_pixmap = None



reply via email to

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