diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2010-07-05 21:03:37 +0300 |
---|---|---|
committer | Bernd Zeimetz <bernd@bzed.de> | 2010-08-31 22:03:34 +0200 |
commit | 451bdc4ffbba05230f5cdf75266526370779c4d5 (patch) | |
tree | 77b071ff62a3e200ee755d3eded5477568192e5d /xgps | |
parent | 3c99b197d4eb05280626b07cbb7719db6fcd831d (diff) | |
download | gpsd-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-x | xgps | 16 |
1 files changed, 0 insertions, 16 deletions
@@ -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 |