Enlightenment CVS committal
Author : sebastid
Project : e17
Module : proto
Dir : e17/proto/enterminus/src/bin
Modified Files:
handlers.c ui.c
Log Message:
Is this right?
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/handlers.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- handlers.c 28 Feb 2005 12:16:39 -0000 1.12
+++ handlers.c 28 Feb 2005 12:34:32 -0000 1.13
@@ -419,8 +419,15 @@
* defaults to the full screen
*/
DPRINT((stderr, "ESC [ [ t ; b ] r Set Scrolling Region
(CSR)\n"));
- term->scroll_region_start = args[0] ? args[0] - 1: 0;
- term->scroll_region_end = args[1] ? args[1] : term->rows;
+ /* scroll_region_start should be 0-indexed */
+ term->scroll_region_start = args[0] ? args[0] - 1 : 0;
+ if (term->scroll_region_start < 0)
+ term->scroll_region_start = 0;
+ /* scroll_region_end should be one after the wanted row */
+ term->scroll_region_end = args[1] ? args[1] - 1 : term->rows - 1;
+ if (term->scroll_region_end >= term->rows)
+ term->scroll_region_end = term->rows - 1;
+
if (!narg) {
/* Reset scroll region */
term->scroll_in_region = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/ui.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ui.c 28 Feb 2005 12:19:46 -0000 1.25
+++ ui.c 28 Feb 2005 12:34:32 -0000 1.26
@@ -280,7 +280,7 @@
void
term_scroll_up(Term *term, int rows)
{
- int i, j, x;
+ int i, j, x, y;
Term_TGlyph *gl;
if (term->scroll_in_region) {
@@ -288,6 +288,19 @@
DPRINT((stderr,"Scrolling: in region between %d and %d\n",
term->scroll_region_start,
term->scroll_region_end));
+ for (i = term->scroll_region_start, x = term->tcanvas->pos +
term->scroll_region_start;
+ i < term->scroll_region_end; i++, x++) {
+ if (x >= term->tcanvas->size)
+ x = 0;
+ y = x + rows;
+ if (y >= term->tcanvas->size)
+ y = 0;
+ for (j = 0; j < term->cols; j++) {
+ term->tcanvas->grid[x][j] = term->tcanvas->grid[y][j];
+ gl = &term->tcanvas->grid[x][j];
+ gl->changed = 1;
+ }
+ }
} else {
DPRINT((stderr, "Scrolling: window\n"));
term->tcanvas->pos += rows;
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs