From 0bd8465b33c6e3f6dacf79785a47cbd6abea6f25 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 22 Mar 2021 18:32:06 +0200 Subject: iOS: Default UI scaling for iPad --- src/ui/metrics.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui') diff --git a/src/ui/metrics.c b/src/ui/metrics.c index 537aaf98..2405eae4 100644 --- a/src/ui/metrics.c +++ b/src/ui/metrics.c @@ -21,6 +21,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "metrics.h" +#include "app.h" #include @@ -32,6 +33,12 @@ iInt2 gap2_UI = { defaultGap_Metrics, defaultGap_Metrics }; int fontSize_UI = defaultFontSize_Metrics; void setPixelRatio_Metrics(float pixelRatio) { +#if defined (iPlatformAppleMobile) + /* iPad needs a bit larger UI elements as the viewing distance is generally longer.*/ + if (deviceType_App() == tablet_AppDeviceType) { + pixelRatio *= 1.1f; + } +#endif gap_UI = iRound(defaultGap_Metrics * pixelRatio); gap2_UI = init1_I2(gap_UI); fontSize_UI = iRound(defaultFontSize_Metrics * pixelRatio); -- cgit v1.2.3