diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-22 18:32:06 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-22 18:32:22 +0200 |
commit | 0bd8465b33c6e3f6dacf79785a47cbd6abea6f25 (patch) | |
tree | 45d034105c50d232fb323f4a02e0b6ec04209dd5 | |
parent | 36ad6cd20a07aecf69e92e9fa724beef14be536a (diff) |
iOS: Default UI scaling for iPad
-rw-r--r-- | src/ui/metrics.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 | |||
21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | 21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
22 | 22 | ||
23 | #include "metrics.h" | 23 | #include "metrics.h" |
24 | #include "app.h" | ||
24 | 25 | ||
25 | #include <the_Foundation/math.h> | 26 | #include <the_Foundation/math.h> |
26 | 27 | ||
@@ -32,6 +33,12 @@ iInt2 gap2_UI = { defaultGap_Metrics, defaultGap_Metrics }; | |||
32 | int fontSize_UI = defaultFontSize_Metrics; | 33 | int fontSize_UI = defaultFontSize_Metrics; |
33 | 34 | ||
34 | void setPixelRatio_Metrics(float pixelRatio) { | 35 | void setPixelRatio_Metrics(float pixelRatio) { |
36 | #if defined (iPlatformAppleMobile) | ||
37 | /* iPad needs a bit larger UI elements as the viewing distance is generally longer.*/ | ||
38 | if (deviceType_App() == tablet_AppDeviceType) { | ||
39 | pixelRatio *= 1.1f; | ||
40 | } | ||
41 | #endif | ||
35 | gap_UI = iRound(defaultGap_Metrics * pixelRatio); | 42 | gap_UI = iRound(defaultGap_Metrics * pixelRatio); |
36 | gap2_UI = init1_I2(gap_UI); | 43 | gap2_UI = init1_I2(gap_UI); |
37 | fontSize_UI = iRound(defaultFontSize_Metrics * pixelRatio); | 44 | fontSize_UI = iRound(defaultFontSize_Metrics * pixelRatio); |