http://www.jwz.org/xscreensaver/xscreensaver-5.12.tar.gz
[xscreensaver] / utils / erase.c
index 4e7a9d40ca1184d50a60818d1722b9e2a1385e5c..05b213e2aec540a4fac553b57f2e4b0367b560a3 100644 (file)
@@ -1,5 +1,5 @@
 /* erase.c: Erase the screen in various more or less interesting ways.
- * Copyright (c) 1997-2001, 2006 Jamie Zawinski <jwz@jwz.org>
+ * Copyright (c) 1997-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -513,7 +513,9 @@ slide_lines (eraser_state *st)
 
   for (y = 0; y < st->height; y += h)
     {
-      if (tick & 1)
+      if (st->width <= step)
+        ;
+      else if (tick & 1)
         {
           XCopyArea (st->dpy, st->window, st->window, st->fg_gc,
                      0, y, st->width-step, h, step, y);
@@ -572,12 +574,7 @@ losira (eraser_state *st)
   else if (st->ratio < mode2)          /* squeeze from the top/bottom */
     {
       double ratio = (st->ratio - mode1) / (mode2 - mode1);
-      double prev_ratio = (st->prev_ratio - mode1) / (mode2 - mode1);
       int max = st->height / 2;
-      int step = (max * ratio) - (max * prev_ratio);
-
-      if (step <= 0)
-        step = 1;
 
       /* fill middle */
       XFillRectangle (st->dpy, st->window, st->fg_gc,