projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug with non-element graphics while custom game tile size defined
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index 0bd9af8403d35c5a2de0cbdc3fb445a98d603b0b..9f679ac4e2125778244d5c6fa9d30c8d4afb4ec2 100644
(file)
--- 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 != 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) */
}
if (pos_text != NULL) /* (x/y may be -1/-1 here) */
@@
-972,18
+970,19
@@
static void InitializeMainControls()
/* calculate size for non-clickable text -- needed for text alignment */
boolean calculate_text_size = (pos_button == NULL && text != NULL);
/* calculate size for non-clickable text -- needed for text alignment */
boolean calculate_text_size = (pos_button == NULL && text != NULL);
+ if (pos_text->width == -1 || calculate_text_size)
+ pos_text->width = text_width;
+ if (pos_text->height == -1 || calculate_text_size)
+ pos_text->height = text_height;
+
if (visibleMenuPos(pos_button))
{
if (pos_text->x == -1)
pos_text->x = pos_button->x + pos_button->width;
if (pos_text->y == -1)
if (visibleMenuPos(pos_button))
{
if (pos_text->x == -1)
pos_text->x = pos_button->x + pos_button->width;
if (pos_text->y == -1)
- pos_text->y = pos_button->y;
+ pos_text->y =
+ pos_button->y + (pos_button->height - pos_text->height) / 2;
}
}
-
- if (pos_text->width == -1 || calculate_text_size)
- pos_text->width = text_width;
- if (pos_text->height == -1 || calculate_text_size)
- pos_text->height = text_height;
}
if (pos_input != NULL) /* (x/y may be -1/-1 here) */
}
if (pos_input != NULL) /* (x/y may be -1/-1 here) */
@@
-6568,8
+6567,8
@@
static void CreateScreenScrollbuttons()
height = SC_SCROLLBUTTON_YSIZE;
/* correct scrollbar position if placed outside menu (playfield) area */
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 > S
X + S
C_SCROLL_UP_XPOS)
+ x = S
X + S
C_SCROLL_UP_XPOS;
if (id == SCREEN_CTRL_ID_SCROLL_DOWN)
y = mSY + (SC_SCROLL_VERTICAL_YPOS +
if (id == SCREEN_CTRL_ID_SCROLL_DOWN)
y = mSY + (SC_SCROLL_VERTICAL_YPOS +
@@
-6637,8
+6636,8
@@
static void CreateScreenScrollbars()
height = scrollbar_info[i].height;
/* correct scrollbar position if placed outside menu (playfield) area */
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 > S
X + S
C_SCROLL_VERTICAL_XPOS)
+ x = S
X + S
C_SCROLL_VERTICAL_XPOS;
if (id == SCREEN_CTRL_ID_SCROLL_VERTICAL)
height = (NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE;
if (id == SCREEN_CTRL_ID_SCROLL_VERTICAL)
height = (NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE;