[meld: 176/180] gutterrendererchunk: Don't stroke non-existent outlines



commit d6681201a7373be1e8d31ef67f3a8664d92583f0
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jul 5 08:23:32 2015 +1000

    gutterrendererchunk: Don't stroke non-existent outlines

 meld/gutterrendererchunk.py |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 5b4dff3..576d79b 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -64,14 +64,15 @@ class MeldGutterRenderer(object):
                     context.set_source_rgba(*highlight)
                 context.fill()
 
-                context.set_source_rgba(*self.line_colors[chunk[0]])
-                if line == chunk[1]:
-                    context.move_to(x, y + 0.5)
-                    context.rel_line_to(width, 0)
-                if line == chunk[2] - 1:
-                    context.move_to(x, y - 0.5 + height)
-                    context.rel_line_to(width, 0)
-                context.stroke()
+                if line == chunk[1] or line == chunk[2] - 1:
+                    context.set_source_rgba(*self.line_colors[chunk[0]])
+                    if line == chunk[1]:
+                        context.move_to(x, y + 0.5)
+                        context.rel_line_to(width, 0)
+                    if line == chunk[2] - 1:
+                        context.move_to(x, y - 0.5 + height)
+                        context.rel_line_to(width, 0)
+                    context.stroke()
         context.restore()
 
 


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