[meld: 150/180] sourceview: Refactor some variable ordering



commit a7336cc6fb9ded22daa30099a1ac6a34130b415f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue Nov 11 06:38:45 2014 +1000

    sourceview: Refactor some variable ordering

 meld/sourceview.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/meld/sourceview.py b/meld/sourceview.py
index fb0a04f..77778e7 100644
--- a/meld/sourceview.py
+++ b/meld/sourceview.py
@@ -162,9 +162,8 @@ class MeldSourceView(GtkSource.View):
             return GtkSource.View.do_draw_layer(self, layer, context)
 
         context.save()
+        context.set_line_width(1.0)
 
-        visible = self.get_visible_rect()
-        textbuffer = self.get_buffer()
         _, rect = Gdk.cairo_get_clip_rectangle(context)
         _, y = self.window_to_buffer_coords(
             Gtk.TextWindowType.WIDGET, 0, rect.y)
@@ -173,8 +172,8 @@ class MeldSourceView(GtkSource.View):
         bounds = (self.get_line_num_for_y(y),
                   self.get_line_num_for_y(y_end))
 
+        visible = self.get_visible_rect()
         width = self.get_allocation().width
-        context.set_line_width(1.0)
 
         # Paint chunk backgrounds and outlines
         for change in self.chunk_iter(bounds):
@@ -193,6 +192,8 @@ class MeldSourceView(GtkSource.View):
             context.set_source_rgba(*self.line_colors[change[0]])
             context.stroke()
 
+        textbuffer = self.get_buffer()
+
         # Paint current line highlight
         if self.props.highlight_current_line_local and self.is_focus():
             it = textbuffer.get_iter_at_mark(textbuffer.get_insert())


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