]> git.gag.com Git - debian/gnuradio/commitdiff
do not call is_valid within draw
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Tue, 4 Nov 2008 05:33:08 +0000 (05:33 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Tue, 4 Nov 2008 05:33:08 +0000 (05:33 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9927 221aa14e-8319-0410-a670-987f0aec2ac5

grc/src/platforms/gui/Connection.py

index 44048e1816c669a69110e5316dea27e0af297114..b130611fbfe610dea246d7df6c994a0816ac4c3f 100644 (file)
@@ -59,6 +59,8 @@ class Connection(Element):
                        Utils.get_rotated_coordinate((-CONNECTOR_ARROW_HEIGHT, CONNECTOR_ARROW_BASE/2), self.get_sink().get_rotation()),
                ]
                self._update_after_move()
+               if self.is_valid(): self._foreground = Colors.FG_COLOR
+               else: self._foreground = Colors.ERROR_COLOR
 
        def _update_after_move(self):
                """Calculate coordinates."""
@@ -123,7 +125,6 @@ class Connection(Element):
                fg_color = self.get_enabled() and Colors.FG_COLOR or Colors.DISABLED_FG_COLOR
                Element.draw(self, window, FG_color=fg_color)
                gc = self.get_gc()
-               if self.is_valid(): gc.foreground = Colors.FG_COLOR
-               else: gc.foreground = Colors.ERROR_COLOR
+               gc.foreground = self._foreground
                #draw arrow on sink port
                window.draw_polygon(gc, True, self._arrow)