public void horizontal_erase (DisplayHack hack) {
    Window window = hack.window;
    int dx = Math.max (1, window.width / DELAY * hack.eraser_delta);
    int dy = Math.max (1, window.height / SLICE * hack.eraser_delta);

    for (int x=0; x<window.width; x+=dx) {
      for (int y=0; y<window.height; y+=dy) {
        int from_x, to_x, clear_x;

        if ((y/dy) % 2 == 1) {
          from_x = x;
          to_x = x + dx;
          clear_x = x;

        } else {
          from_x = dx;
          to_x = 0;
          clear_x = window.width - x - dx;
        }
          
        window.copy_area (window, hack.eraser_gc, from_x, y, 
          window.width-x-dx, dy, to_x, y);
        window.clear_area (clear_x, y, dx, dy, false);
      }

      if (sleep (hack)) return;
    }
  }