Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/moon.py
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2011-06-16 14:03:57 (GMT)
committer Gary Martin <gary@garycmartin.com>2011-06-16 14:03:57 (GMT)
commit2352cdd8d7332ca4122018eadf85db1877651960 (patch)
tree1058a86852998663991ce5dc39be6e9de4c38c09 /moon.py
parent4085265afd702516cfd0d79b685b3540f32d8193 (diff)
Fixs for gtk no longer liking floats, triggered during an eclipse [OLPC #11002, SL #2895].
Diffstat (limited to 'moon.py')
-rwxr-xr-xmoon.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/moon.py b/moon.py
index e730411..ee071dc 100755
--- a/moon.py
+++ b/moon.py
@@ -336,11 +336,15 @@ class MoonActivity(activity.Activity):
eclipse_alpha = self.data_model.next_lunar_eclipse_sec / 7200.0 * 256
else:
eclipse_alpha = min(self.data_model.next_lunar_eclipse_sec, self.data_model.last_lunar_eclipse_sec) / 7200.0 * 256
- moon_pixbuf.composite(dark_pixbuf, 0, 0, IMAGE_SIZE, IMAGE_SIZE, 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 196 - eclipse_alpha / 2)
+ moon_pixbuf.composite(dark_pixbuf, 0, 0, IMAGE_SIZE, IMAGE_SIZE,
+ 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR,
+ int(196 - eclipse_alpha / 2))
self.image_pixmap.draw_pixbuf(self.gc, dark_pixbuf, 0, 0, 0, 0)
del dark_pixbuf
dark_pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, IMAGE_SIZE, IMAGE_SIZE)
- moon_pixbuf.composite(dark_pixbuf, 0, 0, IMAGE_SIZE, IMAGE_SIZE, 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, eclipse_alpha)
+ moon_pixbuf.composite(dark_pixbuf, 0, 0, IMAGE_SIZE, IMAGE_SIZE,
+ 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR,
+ int(eclipse_alpha))
rgc = self.image_pixmap.new_gc(foreground=self.blue_green_mask_alloc_color, function=gtk.gdk.AND)
self.image_pixmap.draw_rectangle(rgc, True, 0, 0, IMAGE_SIZE, IMAGE_SIZE)
self.image_pixmap.draw_pixbuf(self.gc, dark_pixbuf, 0, 0, 0, 0)