summaryrefslogtreecommitdiff
path: root/xgps
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-07-05 21:03:37 +0300
committerBernd Zeimetz <bernd@bzed.de>2010-08-31 22:03:34 +0200
commit451bdc4ffbba05230f5cdf75266526370779c4d5 (patch)
tree77b071ff62a3e200ee755d3eded5477568192e5d /xgps
parent3c99b197d4eb05280626b07cbb7719db6fcd831d (diff)
downloadgpsd-451bdc4ffbba05230f5cdf75266526370779c4d5.tar.gz
xgps: Remove gratuitous saves and restores of cairo context.
The save()/restore() pairs do nothing for the code, since there's no state modification between the pairs that actually gets saved by CairoContext.save().
Diffstat (limited to 'xgps')
-rwxr-xr-xxgps16
1 files changed, 0 insertions, 16 deletions
diff --git a/xgps b/xgps
index c76cd6c2..543181a3 100755
--- a/xgps
+++ b/xgps
@@ -78,8 +78,6 @@ class SkyView(gtk.DrawingArea):
def draw_circle(self, x, y, radius, filled=False):
"Draw a circle centered on the specified midpoint."
- self.cr.save()
-
self.cr.arc(x, y, radius, 0, math.pi * 2.0)
if filled:
@@ -87,22 +85,14 @@ class SkyView(gtk.DrawingArea):
else:
self.cr.stroke()
- self.cr.restore()
-
def draw_line(self, x1, y1, x2, y2):
"Draw a line between specified points."
- self.cr.save()
-
self.cr.move_to(int(x1), int(y1))
self.cr.line_to(int(x2), int(y2))
self.cr.stroke()
- self.cr.restore()
-
def draw_square(self, x, y, radius, filled=False):
"Draw a square centered on the specified midpoint."
- self.cr.save()
-
self.cr.rectangle(x - radius, y - radius, radius * 2, radius * 2)
if filled:
@@ -110,12 +100,8 @@ class SkyView(gtk.DrawingArea):
else:
self.cr.stroke()
- self.cr.restore()
-
def draw_string(self, x, y, letter, centered=True):
"Draw a letter on the skyview."
- self.cr.save()
-
self.cr.select_font_face("Sans", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_BOLD)
self.cr.set_font_size(10)
@@ -130,8 +116,6 @@ class SkyView(gtk.DrawingArea):
self.cr.show_text(letter)
self.cr.new_path()
- self.cr.restore()
-
def pol2cart(self, az, el):
"Polar to Cartesian coordinates within the horizon circle."
az *= (math.pi/180) # Degrees to radians