From 4fe9164460ddbdc1077604bac5c418f02fd8fa2b Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 21 Feb 2005 03:15:00 +0100 Subject: [PATCH] rnd-20050221-1-src * fixed small bug when dragging scrollbars to end positions --- ChangeLog | 3 +++ src/conftime.h | 2 +- src/libgame/gadgets.c | 21 +++++++++++++++------ src/screens.c | 2 ++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index df68d095..177d856c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2005-02-20 + * fixed small bug when dragging scrollbars to end positions + 2005-02-14 * added editor element descriptions written by Aaron Davidson diff --git a/src/conftime.h b/src/conftime.h index af5496e0..7ea708d6 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-02-20 00:31]" +#define COMPILE_DATE_STRING "[2005-02-21 00:38]" diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index a134b049..aaf01eb7 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -1717,7 +1717,7 @@ boolean HandleGadgets(int mx, int my, int button) if (gs->item_position < 0) gs->item_position = 0; - if (gs->item_position > gs->items_max - gs->items_visible) + else if (gs->item_position > gs->items_max - gs->items_visible) gs->item_position = gs->items_max - gs->items_visible; if (old_item_position != gs->item_position) @@ -1799,13 +1799,22 @@ boolean HandleGadgets(int mx, int my, int button) gs->position = scrollbar_mouse_pos - gs->drag_position; - if (gs->position < 0) + /* make sure to always precisely reach end positions when dragging */ + if (gs->position <= 0) + { gs->position = 0; - if (gs->position > gs->position_max) + gs->item_position = 0; + } + else if (gs->position >= gs->position_max) + { gs->position = gs->position_max; - - gs->item_position = - gs->items_max * (gs->position + gs->correction) / gs->size_max_cmp; + gs->item_position = gs->items_max - gs->items_visible; + } + else + { + gs->item_position = + gs->items_max * (gs->position + gs->correction) / gs->size_max_cmp; + } if (gs->item_position < 0) gs->item_position = 0; diff --git a/src/screens.c b/src/screens.c index 6e48ea83..5f93823b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -466,7 +466,9 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) SaveLevelSetup_LastSeries(); SaveLevelSetup_SeriesInfo(); +#if 0 gotoTopLevelDir(); +#endif DrawChooseLevel(); } -- 2.34.1