+
+ /*
+ * Work out the part of the update region that will scrolled by
+ * this operation.
+ */
+ if (lines > 0)
+ SetRectRgn(scrollrgn, 0, (topline + lines) * s->font_height,
+ s->term->cols * s->font_width,
+ (botline + 1) * s->font_height);
+ else
+ SetRectRgn(scrollrgn, 0, topline * s->font_height,
+ s->term->cols * s->font_width,
+ (botline - lines + 1) * s->font_height);
+ CopyRgn(((WindowPeek)s->window)->updateRgn, movedupdate);
+ GlobalToLocal(&g2l);
+ OffsetRgn(movedupdate, g2l.h, g2l.v); /* Convert to local co-ords. */
+ SectRgn(scrollrgn, movedupdate, movedupdate); /* Clip scrolled section. */
+ ValidRgn(movedupdate);
+ OffsetRgn(movedupdate, 0, -lines * s->font_height); /* Scroll it. */
+