diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 15:06:52 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 15:07:38 +0300 |
commit | d773b499e595a43b9b1ae449262dcf13cabf2d02 (patch) | |
tree | b1baeb12025a04f8316636b5d0ab18e30ceedb2c /src/ui/metrics.c |
Initial commit
Borrowing the app skeleton from Bitwise Harmony.
Diffstat (limited to 'src/ui/metrics.c')
-rw-r--r-- | src/ui/metrics.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ui/metrics.c b/src/ui/metrics.c new file mode 100644 index 00000000..38ae5955 --- /dev/null +++ b/src/ui/metrics.c | |||
@@ -0,0 +1,16 @@ | |||
1 | #include "metrics.h" | ||
2 | |||
3 | #include <the_Foundation/math.h> | ||
4 | |||
5 | #define defaultFontSize_Metrics 16 | ||
6 | #define defaultGap_Metrics 4 | ||
7 | |||
8 | int gap_UI = defaultGap_Metrics; | ||
9 | iInt2 gap2_UI = { defaultGap_Metrics, defaultGap_Metrics }; | ||
10 | int fontSize_UI = defaultFontSize_Metrics; | ||
11 | |||
12 | void setPixelRatio_Metrics(float pixelRatio) { | ||
13 | gap_UI = iRound(defaultGap_Metrics * pixelRatio); | ||
14 | gap2_UI = init1_I2(gap_UI); | ||
15 | fontSize_UI = iRound(defaultFontSize_Metrics * pixelRatio); | ||
16 | } | ||