]> granicus.if.org Git - nethack/commitdiff
X11 map scrolling behavior [from Steve VanDevender]
authorcohrs <cohrs>
Sun, 3 Oct 2004 22:04:20 +0000 (22:04 +0000)
committercohrs <cohrs>
Sun, 3 Oct 2004 22:04:20 +0000 (22:04 +0000)
This isn't really a bug, but I find it does make the map scrolling in
the generic X11 version a lot less distracting.  The original behavior
produces certain boundaries where, when the cursor moves back and forth
across that boundary, the map scrolls with each crossing.  This is
particularly annoying in places like Sokoban where the player makes that
kind of movement frequently causing large jumps of the map each time.
Changing the border and delta constants in winmap.c as below eliminates
that behavior, as well as making the cursor easier to track by tending
to recenter it whenever the map shifts.

win/X11/winmap.c

index a72ea51ec58d2d604f01464f096481b2dd875137..2d805d37ef1b9ae42b956d83ab8ff51447f45e22 100644 (file)
@@ -559,11 +559,11 @@ check_cursor_visibility(wp)
 
 /* All values are relative to currently visible area */
 
-#define V_BORDER 0.  /* if this far from vert edge, shift */
-#define H_BORDER 0.  /* if this from from horiz edge, shift */
+#define V_BORDER 0.25  /* if this far from vert edge, shift */
+#define H_BORDER 0.25  /* if this from from horiz edge, shift */
 
-#define H_DELTA 0.   /* distance of horiz shift */
-#define V_DELTA 0.   /* distance of vert shift */
+#define H_DELTA 0.25   /* distance of horiz shift */
+#define V_DELTA 0.25   /* distance of vert shift */
 
     if (horiz_sb) {
        XtSetArg(arg[0], XtNshown,      &shown);