Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses prefresh - fix current position calculations



details:   https://anonhg.NetBSD.org/src/rev/b0c8a3f16d0f
branches:  trunk
changeset: 447276:b0c8a3f16d0f
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Jan 06 03:46:11 2019 +0000

description:
prefresh - fix current position calculations

The code was copy-pasted from wrefresh(), but for pads we need to
adjust for (pbegy, pbegx).

PR lib/53801

diffstat:

 lib/libcurses/refresh.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 688adab0d0ca -r b0c8a3f16d0f lib/libcurses/refresh.c
--- a/lib/libcurses/refresh.c   Sun Jan 06 01:22:50 2019 +0000
+++ b/lib/libcurses/refresh.c   Sun Jan 06 03:46:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.102 2018/11/30 04:38:14 roy Exp $        */
+/*     $NetBSD: refresh.c,v 1.103 2019/01/06 03:46:11 uwe Exp $        */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c  8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.102 2018/11/30 04:38:14 roy Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.103 2019/01/06 03:46:11 uwe Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -498,8 +498,8 @@
        if (retval == OK) {
                retval = doupdate();
                if (!(pad->flags & __LEAVEOK)) {
-                       pad->cury = max(0, curscr->cury - pad->begy);
-                       pad->curx = max(0, curscr->curx - pad->begx);
+                       pad->cury = max(0, pbegy + (curscr->cury - sbegy));
+                       pad->curx = max(0, pbegx + (curscr->curx - sbegx));
                }
        }
        return retval;



Home | Main Index | Thread Index | Old Index