+
+/* from Frederick Roeber <roeber@xigo.com> */
+static void
+losira (eraser_state *st)
+{
+ double mode1 = 0.55;
+ double mode2 = mode1 + 0.30;
+ double mode3 = 1.0;
+ int radius = 10;
+
+ if (st->ratio < mode1) /* squeeze from the sides */
+ {
+ double ratio = st->ratio / mode1;
+ double prev_ratio = st->prev_ratio / mode1;
+ int max = st->width / 2;
+ int step = (max * ratio) - (max * prev_ratio);
+
+ if (step <= 0)
+ step = 1;
+
+ /* pull from left */
+ XCopyArea (st->dpy, st->window, st->window, st->fg_gc,
+ 0, 0, max - step, st->height, step, 0);
+ XFillRectangle (st->dpy, st->window, st->bg_gc,
+ 0, 0, max * ratio, st->height);
+
+ /* pull from right */
+ XCopyArea (st->dpy, st->window, st->window, st->fg_gc,
+ max+step, 0, max - step, st->height, max, 0);
+ XFillRectangle (st->dpy, st->window, st->bg_gc,
+ max + max*(1-ratio), 0, max, st->height);
+
+ /* expand white from center */
+ XFillRectangle (st->dpy, st->window, st->fg_gc,
+ max - (radius * ratio), 0,
+ radius * ratio * 2, st->height);
+ }
+ else if (st->ratio < mode2) /* squeeze from the top/bottom */
+ {
+ double ratio = (st->ratio - mode1) / (mode2 - mode1);
+ int max = st->height / 2;
+
+ /* fill middle */
+ XFillRectangle (st->dpy, st->window, st->fg_gc,
+ st->width/2 - radius,
+ max * ratio,
+ radius*2, st->height * (1 - ratio));
+
+ /* fill left and right */
+ XFillRectangle (st->dpy, st->window, st->bg_gc,
+ 0, 0, st->width/2 - radius, st->height);
+ XFillRectangle (st->dpy, st->window, st->bg_gc,
+ st->width/2 + radius, 0, st->width/2, st->height);
+
+ /* fill top and bottom */
+ XFillRectangle (st->dpy, st->window, st->bg_gc,
+ 0, 0, st->width, max * ratio);
+ XFillRectangle (st->dpy, st->window, st->bg_gc,
+ 0, st->height - (max * ratio),
+ st->width, max);
+
+ /* cap top */
+ XFillArc (st->dpy, st->window, st->fg_gc,
+ st->width/2 - radius,
+ max * ratio - radius,
+ radius*2, radius*2,
+ 0, 180*64);
+
+ /* cap bottom */
+ XFillArc (st->dpy, st->window, st->fg_gc,
+ st->width/2 - radius,
+ st->height - (max * ratio + radius),
+ radius*2, radius*2,
+ 180*64, 180*64);
+ }
+ else /* starburst */