[meld] gutterrendererchunk: Remove superfluous context saving
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] gutterrendererchunk: Remove superfluous context saving
- Date: Sun, 2 Oct 2016 00:12:40 +0000 (UTC)
commit 0455bd45137ed65160da29b03873e173975cc7c2
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Sep 25 11:37:39 2016 +1000
gutterrendererchunk: Remove superfluous context saving
The GtkSourceGutter already makes sure to save and restore its context
around us, so we don't need to repeat that here.
meld/gutterrendererchunk.py | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 11c2ecb..ccb2081 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -61,9 +61,6 @@ class MeldGutterRenderer(object):
width = background_area.width + 2
height = 1 if chunk[1] == chunk[2] else background_area.height
- context.save()
- context.set_line_width(1.0)
-
context.rectangle(x, y, width, height)
context.set_source_rgba(*self.fill_colors[chunk[0]])
@@ -74,6 +71,7 @@ class MeldGutterRenderer(object):
context.fill()
if line == chunk[1] or line == chunk[2] - 1:
+ context.set_line_width(1.0)
context.set_source_rgba(*self.line_colors[chunk[0]])
if line == chunk[1]:
context.move_to(x, y + 0.5)
@@ -83,8 +81,6 @@ class MeldGutterRenderer(object):
context.rel_line_to(width, 0)
context.stroke()
- context.restore()
-
class GutterRendererChunkAction(
GtkSource.GutterRendererPixbuf, MeldGutterRenderer):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]