X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=469239d18b48fc4b779cc9f0f9823d94718ed1e4;hb=307b13d025b6b0a5011c74efa3a2c023d3986ebb;hp=ae35cda2e225c8b999e98111604d95207978218f;hpb=dbe473b63ac67dabfb47c82e104f2b8f33ca2d51;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index ae35cda2..469239d1 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) */ @@ -3273,8 +3271,8 @@ static void clearMenuListArea() int scrollbar_xpos = mSX + SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset; /* correct scrollbar position if placed outside menu (playfield) area */ - if (scrollbar_xpos > SC_SCROLLBAR_XPOS) - scrollbar_xpos = SC_SCROLLBAR_XPOS; + if (scrollbar_xpos > mSX + SC_SCROLLBAR_XPOS) + scrollbar_xpos = mSX + SC_SCROLLBAR_XPOS; /* clear menu list area, but not title or scrollbar */ DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32, @@ -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;