curses cursor

Followup to 1c03d0970115c776d1c4791fea3c33f70b0b5378; that had been
too easy.  When map was clipped and panned to the side, the highlight
for hero's spot was shown next to the '@' instead of on it.
This commit is contained in:
PatR
2019-06-25 02:30:27 -07:00
parent 6506f769a6
commit 3bd46a3536
2 changed files with 7 additions and 5 deletions

View File

@@ -519,8 +519,6 @@ curses_move_cursor(winid wid, int x, int y)
if (wid != MAP_WIN) {
return;
} else {
--x; /* map column [0] isn't used, so shift everything over 1 col */
}
#ifdef PDCURSES
/* PDCurses seems to not handle wmove correctly, so we use move and
@@ -536,8 +534,9 @@ curses_move_cursor(winid wid, int x, int y)
curs_y++;
}
if ((x >= sx) && (x <= ex) && (y >= sy) && (y <= ey)) {
curs_x -= sx;
if (x >= sx && x <= ex && y >= sy && y <= ey) {
/* map column #0 isn't used; shift column #1 to first screen column */
curs_x -= (sx + 1);
curs_y -= sy;
#ifdef PDCURSES
move(curs_y, curs_x);