-static void fix_rect(rtk_rect *rect)
-{
- int x, y, w, h;
-
- x = rband.x;
- y = rband.y;
-
- if(rband.width < 0) {
- w = -rband.width;
- x += rband.width;
- } else {
- w = rband.width;
- }
- if(rband.height < 0) {
- h = -rband.height;
- y += rband.height;
- } else {
- h = rband.height;
- }
-
- rect->x = x;
- rect->y = y;
- rect->width = w;
- rect->height = h;
-}
-
-static void draw_rband(void)
-{
- int i;
- rtk_rect rect;
- uint32_t *fbptr, *bptr;
-
- rect = rband;
- fix_rect(&rect);
-
- fbptr = framebuf + rect.y * win_width + rect.x;
- bptr = fbptr + win_width * (rect.height - 1);
-
- for(i=0; i<rect.width; i++) {
- fbptr[i] ^= 0xffffff;
- bptr[i] ^= 0xffffff;
- }
- fbptr += win_width;
- for(i=0; i<rect.height-2; i++) {
- fbptr[0] ^= 0xffffff;
- fbptr[rect.width - 1] ^= 0xffffff;
- fbptr += win_width;
- }
- app_redisplay(rect.x, rect.y, rect.width, rect.height);
-}