From: Taylor R Campbell Date: Fri, 15 Oct 2010 03:28:33 +0000 (+0000) Subject: Fix and simplify recent change to xterm_dump_rectangle. X-Git-Tag: 20101212-Gtk~37 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=03ba2adfad1c86461acbd08d70909acde352d641;p=mit-scheme.git Fix and simplify recent change to xterm_dump_rectangle. --- diff --git a/src/microcode/x11term.c b/src/microcode/x11term.c index a26d69ca9..3ed75c46b 100644 --- a/src/microcode/x11term.c +++ b/src/microcode/x11term.c @@ -282,26 +282,27 @@ xterm_dump_rectangle (struct xwindow * xw, unsigned int height) { XFontStruct * font = (XW_FONT (xw)); - int x, y; + unsigned int x = ((signed_x < 0) ? 0 : ((unsigned int) signed_x)); + unsigned int y = ((signed_y < 0) ? 0 : ((unsigned int) signed_y)); unsigned int fwidth = (FONT_WIDTH (font)); unsigned int fheight = (FONT_HEIGHT (font)); unsigned int border = (XW_INTERNAL_BORDER_WIDTH (xw)); - if ((signed_x < 0) || (((unsigned int) signed_x) < border)) + if (x < border) { - width -= (border - ((unsigned int) signed_x)); + width -= (border - x); x = 0; } else - x = (((unsigned int) signed_x) - border); + x -= border; if ((x + width) > (XW_X_SIZE (xw))) width = ((XW_X_SIZE (xw)) - x); - if ((signed_y < 0) || (((unsigned int) signed_y) < border)) + if (y < border) { - height -= (border - ((unsigned int) signed_y)); + height -= (border - y); y = 0; } else - y = (((unsigned int) signed_y) - border); + y -= border; if ((y + height) > (XW_Y_SIZE (xw))) height = ((XW_Y_SIZE (xw)) - y); {