summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--examples/pygtk-demo/demos/pixbufs.py15
2 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 70a27904..aa3533d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
+2006-04-02 Ben Caradoc-Davies <ben@wintersun.org>
+
+ reviewed by: Johan
+
+ * examples/pygtk-demo/demos/pixbufs.py: Remove
+ discontinuous motion, fixes #327931
+
2006-04-02 Johan Dahlin <johan@gnome.org>
+
* gtk/gtkmodule.c (init_gtk): GDK_PARENT_RELATIVE constant
* gtk/gtk-types.c (pygtk_style_helper_setitem): Add support for
diff --git a/examples/pygtk-demo/demos/pixbufs.py b/examples/pygtk-demo/demos/pixbufs.py
index 29376da9..191312c9 100644
--- a/examples/pygtk-demo/demos/pixbufs.py
+++ b/examples/pygtk-demo/demos/pixbufs.py
@@ -149,7 +149,10 @@ class PixbufsDemo(gtk.Window):
xpos = math.floor(xmid + r * math.cos(ang) - iw / 2.0 + 0.5)
ypos = math.floor(ymid + r * math.sin(ang) - ih / 2.0 + 0.5)
- k = (i & 1) and math.sin(f * 2.0 * math.pi) or math.cos(f * 2.0 * math.pi)
+ if i % 2 == 0:
+ k = math.cos(f * 2.0 * math.pi)
+ else:
+ k = math.sin(f * 2.0 * math.pi)
k = 2.0 * k * k
k = max(0.25, k)
@@ -168,6 +171,12 @@ class PixbufsDemo(gtk.Window):
dest = r1.intersect(r2)
if dest is not None:
+ if i % 2 == 0:
+ alpha = int(
+ max(127, math.fabs(255 * math.cos(f * 2.0 * math.pi))))
+ else:
+ alpha = int(
+ max(127, math.fabs(255 * math.sin(f * 2.0 * math.pi))))
self.images[i].composite(
self.frame,
dest.x, dest.y,
@@ -175,9 +184,7 @@ class PixbufsDemo(gtk.Window):
xpos, ypos,
k, k,
gtk.gdk.INTERP_NEAREST,
- ((i & 1)
- and int(max(127, math.fabs(255 * math.sin(f * 2.0 * math.pi))))
- or int(max(127, math.fabs(255 * math.cos(f * 2.0 * math.pi))))))
+ alpha)
if self is not None:
self.queue_draw()