Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses Make subwindows scroll correctly.
details: https://anonhg.NetBSD.org/src/rev/ebc8a1b1507e
branches: trunk
changeset: 484983:ebc8a1b1507e
user: mycroft <mycroft%NetBSD.org@localhost>
date: Sun Apr 16 05:48:25 2000 +0000
description:
Make subwindows scroll correctly.
diffstat:
lib/libcurses/id_subwins.c | 20 ++++++--------------
lib/libcurses/insdelln.c | 4 ++--
lib/libcurses/newwin.c | 6 +++---
3 files changed, 11 insertions(+), 19 deletions(-)
diffs (87 lines):
diff -r e0f9f56d4460 -r ebc8a1b1507e lib/libcurses/id_subwins.c
--- a/lib/libcurses/id_subwins.c Sun Apr 16 05:42:40 2000 +0000
+++ b/lib/libcurses/id_subwins.c Sun Apr 16 05:48:25 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: id_subwins.c,v 1.11 2000/04/15 13:17:03 blymn Exp $ */
+/* $NetBSD: id_subwins.c,v 1.12 2000/04/16 05:48:25 mycroft Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)id_subwins.c 8.2 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: id_subwins.c,v 1.11 2000/04/15 13:17:03 blymn Exp $");
+__RCSID("$NetBSD: id_subwins.c,v 1.12 2000/04/16 05:48:25 mycroft Exp $");
#endif
#endif /* not lint */
@@ -53,20 +53,12 @@
__id_subwins(WINDOW *orig)
{
WINDOW *win;
- int oy, realy, y;
+ int oy, y;
- realy = orig->begy + orig->cury;
for (win = orig->nextp; win != orig; win = win->nextp) {
- /*
- * If the window ends before our current position, don't need
- * to do anything.
- */
- if (win->begy + win->maxy <= realy)
- continue;
-
- oy = orig->cury;
- for (y = realy - win->begy; y < win->maxy; y++, oy++)
+ oy = win->begy - orig->begy;
+ for (y = 0; y < win->maxy; y++)
win->lines[y]->line =
- &orig->lines[oy]->line[win->ch_off];
+ &orig->lines[oy + y]->line[win->ch_off];
}
}
diff -r e0f9f56d4460 -r ebc8a1b1507e lib/libcurses/insdelln.c
--- a/lib/libcurses/insdelln.c Sun Apr 16 05:42:40 2000 +0000
+++ b/lib/libcurses/insdelln.c Sun Apr 16 05:48:25 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: insdelln.c,v 1.3 2000/04/15 13:17:04 blymn Exp $ */
+/* $NetBSD: insdelln.c,v 1.4 2000/04/16 05:48:25 mycroft Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -132,6 +132,6 @@
__touchline(win, y, 0, (int) win->maxx - 1, 0);
}
if (win->orig != NULL)
- __id_subwins(win);
+ __id_subwins(win->orig);
return (OK);
}
diff -r e0f9f56d4460 -r ebc8a1b1507e lib/libcurses/newwin.c
--- a/lib/libcurses/newwin.c Sun Apr 16 05:42:40 2000 +0000
+++ b/lib/libcurses/newwin.c Sun Apr 16 05:48:25 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: newwin.c,v 1.17 2000/04/15 22:53:46 jdc Exp $ */
+/* $NetBSD: newwin.c,v 1.18 2000/04/16 05:48:25 mycroft Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)newwin.c 8.3 (Berkeley) 7/27/94";
#else
-__RCSID("$NetBSD: newwin.c,v 1.17 2000/04/15 22:53:46 jdc Exp $");
+__RCSID("$NetBSD: newwin.c,v 1.18 2000/04/16 05:48:25 mycroft Exp $");
#endif
#endif /* not lint */
@@ -141,7 +141,7 @@
for (lp = win->lspace, i = 0; i < win->maxy; i++, lp++) {
win->lines[i] = lp;
olp = orig->lines[i + win->begy - orig->begy];
- lp->line = &olp->line[win->begx - orig->begx];
+ lp->line = &olp->line[win->ch_off];
lp->firstchp = &olp->firstch;
lp->lastchp = &olp->lastch;
lp->hash = __hash((char *)(void *)lp->line,
Home |
Main Index |
Thread Index |
Old Index