Navigation Menu

Skip to content

Commit

Permalink
Fix alignment of text and buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson committed Oct 19, 2020
1 parent e69eb2f commit 025111c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions code/iphone/iphone_loop.c
Expand Up @@ -221,11 +221,11 @@ void SetButtonPics( ibutton_t *button, const char *picBase, const char *title, i
button->scale = 1.0f;
button->title = title;

button->x = x * ((float)displaywidth) / 480.0f;
button->y = y * ((float)displayheight) / 320.0f;
button->x = x * ((float)SCREENWIDTH) / 480.0f;
button->y = y * ((float)SCREENHEIGHT) / 320.0f;

float xRatio = ((float)displaywidth) / 480.0f;
float yRatio = ((float)displayheight) / 320.0f;
float xRatio = ((float)SCREENWIDTH) / 480.0f;
float yRatio = ((float)SCREENHEIGHT) / 320.0f;

float themin = MIN( xRatio, yRatio );

Expand All @@ -236,8 +236,8 @@ void SetButtonPics( ibutton_t *button, const char *picBase, const char *title, i
void SetButtonPicsAndSizes( ibutton_t *button, const char *picBase, const char *title, int x, int y, int w, int h ) {
SetButtonPics( button, picBase, title, x, y );

float xRatio = ((float)displaywidth) / 480.0f;
float yRatio = ((float)displayheight) / 320.0f;
float xRatio = ((float)SCREENWIDTH) / 480.0f;
float yRatio = ((float)SCREENHEIGHT) / 320.0f;

float themin = MIN( xRatio, yRatio );

Expand Down Expand Up @@ -526,8 +526,8 @@ return fx - x;
float iphoneCenterText( float x, float y, float scale, const char *str ) {
float l = StringFontWidth( str );

x *= ((float)displaywidth) / 480.0f;
y *= ((float)displayheight) / 320.0f;
x *= ((float)SCREENWIDTH) / 480.0f;
y *= ((float)SCREENHEIGHT) / 320.0f;

x -= l * scale * 0.5 * screenResolutionScale * 2;

Expand Down

0 comments on commit 025111c

Please sign in to comment.