From 0b571e4120dfc9e5404fe0070114933e097e43db Mon Sep 17 00:00:00 2001 From: Dave Nicolson Date: Mon, 19 Oct 2020 18:59:43 +0200 Subject: [PATCH] Fix alignment of text and buttons --- code/iphone/iphone_loop.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/iphone/iphone_loop.c b/code/iphone/iphone_loop.c index 0f92385..3ffa51a 100755 --- a/code/iphone/iphone_loop.c +++ b/code/iphone/iphone_loop.c @@ -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 ); @@ -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 ); @@ -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;