From: Holger Schemel Date: Mon, 20 Oct 2014 22:45:06 +0000 (+0200) Subject: fixed some initialization bugs for scrollbars and main screen buttons X-Git-Tag: 4.0.0.0-rc1~325 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e513e79ccbc24a8db39a337b5d38a7f9e26a7dcb;p=rocksndiamonds.git fixed some initialization bugs for scrollbars and main screen buttons --- diff --git a/ChangeLog b/ChangeLog index 35d438e2..332ee32d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2014-10-20 * fixed using buttons on main screen with size other than 32x32 pixels + * fixed some initialization bugs for scrollbars and main screen buttons 2014-10-17 * removed some remaining unused X11 stuff diff --git a/src/conftime.h b/src/conftime.h index a8916dbc..44d3b231 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-10-20 23:13" +#define COMPILE_DATE_STRING "2014-10-21 00:38" diff --git a/src/screens.c b/src/screens.c index ae35cda2..9f679ac4 100644 --- a/src/screens.c +++ b/src/screens.c @@ -961,10 +961,8 @@ static void InitializeMainControls() if (pos_button != NULL) /* (x/y may be -1/-1 here) */ { - if (pos_button->width == 0) - pos_button->width = button_width; - if (pos_button->height == 0) - pos_button->height = button_height; + pos_button->width = button_width; + pos_button->height = button_height; } if (pos_text != NULL) /* (x/y may be -1/-1 here) */ @@ -6569,8 +6567,8 @@ static void CreateScreenScrollbuttons() height = SC_SCROLLBUTTON_YSIZE; /* correct scrollbar position if placed outside menu (playfield) area */ - if (x > SC_SCROLL_UP_XPOS) - x = SC_SCROLL_UP_XPOS; + if (x > SX + SC_SCROLL_UP_XPOS) + x = SX + SC_SCROLL_UP_XPOS; if (id == SCREEN_CTRL_ID_SCROLL_DOWN) y = mSY + (SC_SCROLL_VERTICAL_YPOS + @@ -6638,8 +6636,8 @@ static void CreateScreenScrollbars() height = scrollbar_info[i].height; /* correct scrollbar position if placed outside menu (playfield) area */ - if (x > SC_SCROLL_VERTICAL_XPOS) - x = SC_SCROLL_VERTICAL_XPOS; + if (x > SX + SC_SCROLL_VERTICAL_XPOS) + x = SX + SC_SCROLL_VERTICAL_XPOS; if (id == SCREEN_CTRL_ID_SCROLL_VERTICAL) height = (NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE;