Skip to content
Snippets Groups Projects
Commit d991f3c1 authored by deuce's avatar deuce
Browse files

Make Sixel drawings scroll the screen. There's an issue with cursor not

being cleared from the new position now though... I thought I fixed all of
those cases years ago. :(
parent 841b3601
No related branches found
No related tags found
No related merge requests found
...@@ -441,7 +441,6 @@ int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy) ...@@ -441,7 +441,6 @@ int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy)
ssourcepos=((y-1)*vstat.charheight+screeny)*cio_textinfo.screenwidth*vstat.charwidth+(x-1)*vstat.charwidth; ssourcepos=((y-1)*vstat.charheight+screeny)*cio_textinfo.screenwidth*vstat.charwidth+(x-1)*vstat.charwidth;
memmove(&(screen[ssourcepos+sdestoffset]), &(screen[ssourcepos]), sizeof(screen[0])*width*vstat.charwidth); memmove(&(screen[ssourcepos+sdestoffset]), &(screen[ssourcepos]), sizeof(screen[0])*width*vstat.charwidth);
} }
bitmap_draw_cursor(&vstat);
unlock_vmem(vmem_ptr); unlock_vmem(vmem_ptr);
pthread_mutex_unlock(&screenlock); pthread_mutex_unlock(&screenlock);
......
...@@ -1278,8 +1278,8 @@ void draw_sixel(struct cterminal *cterm, char *str) ...@@ -1278,8 +1278,8 @@ void draw_sixel(struct cterminal *cterm, char *str)
struct text_info ti; struct text_info ti;
int i; int i;
char *p; char *p;
int max_row;
SETCURSORTYPE(_NOCURSOR);
GETTEXTINFO(&ti); GETTEXTINFO(&ti);
vmode = find_vmode(ti.currmode); vmode = find_vmode(ti.currmode);
attr2palette(ti.attribute, &fg, &bg); attr2palette(ti.attribute, &fg, &bg);
...@@ -1378,9 +1378,16 @@ void draw_sixel(struct cterminal *cterm, char *str) ...@@ -1378,9 +1378,16 @@ void draw_sixel(struct cterminal *cterm, char *str)
p++; p++;
break; break;
case '-': // Graphics New Line case '-': // Graphics New Line
max_row = cterm->height;
if(cterm->origin_mode)
max_row = cterm->bottom_margin - cterm->top_margin + 1;
x = left; x = left;
y += 6; y += 6;
/* Check y */ if (y + 5 >= (cterm->y + max_row - 1) * vparams[vmode].charheight) {
scrollup(cterm);
y -= vparams[vmode].charheight;
}
p++; p++;
break; break;
default: default:
...@@ -1388,15 +1395,16 @@ void draw_sixel(struct cterminal *cterm, char *str) ...@@ -1388,15 +1395,16 @@ void draw_sixel(struct cterminal *cterm, char *str)
} }
} }
} }
x = x / vparams[vmode].charwidth + 1; x = x / vparams[vmode].charwidth + 1;
x -= cterm->x; x -= (cterm->x - 1);
x++; x++;
y = y / vparams[vmode].charheight + 1; y = y / vparams[vmode].charheight + 1;
y -= cterm->y; y -= (cterm->y - 1);
y++; y++;
GOTOXY(x,y); GOTOXY(x,y);
SETCURSORTYPE(cterm->cursor);
} }
static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *speed) static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *speed)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment