repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 5824ea8a0fbd42e5364c8511868ec0cbda2edb1c:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 5824ea8a0fbd42e5364c8511868ec0cbda2edb1c
Author: Emanuele Giaquinta 
Date:   Fri Feb 1 14:15:10 2008 +0000

    Simplify.

diff --git a/src/command.C b/src/command.C
index 4863bb7f5a418c06c232019b22334331037a5dad..
index ..733d80bf64afde7b10e2a9af3ffba60c47565a77 100644
--- a/src/command.C
+++ b/src/command.C
@@ -1949,12 +1949,12 @@ rxvt_term::button_press (XButtonEvent &ev)
    */
   if (scrollBar.state && ev.window == scrollBar.win)
     {
-      int upordown = 0;
+      page_dirn direction = NO_DIR;

       if (scrollBar.upButton (ev.y))
-        upordown = -1; /* up */
+        direction = UP; /* up */
       else if (scrollBar.dnButton (ev.y))
-        upordown = 1;  /* down */
+        direction = DN;  /* down */

       scrollBar.state = STATE_IDLE;
       /*
@@ -1975,9 +1975,9 @@ rxvt_term::button_press (XButtonEvent &ev)
            * arrow buttons - send up/down
            * click on scrollbar - send pageup/down
            */
-          if (upordown < 0)
+          if (direction == UP)
             tt_printf ("\033[A");
-          else if (upordown > 0)
+          else if (direction == DN)
             tt_printf ("\033[B");
           else
             switch (ev.button)
@@ -1997,15 +1997,15 @@ rxvt_term::button_press (XButtonEvent &ev)
 #endif /* NO_SCROLLBAR_REPORT */

         {
-          if (upordown)
+          if (direction != NO_DIR)
             {
 #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
               if (!cont_scroll_ev.is_active ())
                 cont_scroll_ev.start (SCROLLBAR_INITIAL_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
 #endif
-              if (scr_page (upordown < 0 ? UP : DN, 1))
+              if (scr_page (direction, 1))
                 {
-                  if (upordown < 0)
+                  if (direction == UP)
                     scrollBar.state = STATE_UP;
                   else
                     scrollBar.state = STATE_DOWN;

-----END OF PAGE-----