From: Holger Schemel Date: Mon, 21 Feb 2005 02:15:00 +0000 (+0100) Subject: rnd-20050221-1-src X-Git-Tag: 3.1.1^2~22 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4fe9164460ddbdc1077604bac5c418f02fd8fa2b;p=rocksndiamonds.git rnd-20050221-1-src * fixed small bug when dragging scrollbars to end positions --- 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(); }