diff options
author | pommicket <pommicket@gmail.com> | 2023-07-16 15:07:41 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-07-16 15:42:00 -0400 |
commit | 3f734cf1eb86fef82c7390df003124565b8a84c6 (patch) | |
tree | 193e24ffab1c2a2397fb73292d60653f5ef1c97f /util.c | |
parent | d27853b51f09c080b1c78201a947fcb6b6cc6b72 (diff) |
initial draft of variable-width font handling
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -514,6 +514,12 @@ float clampf(float x, float a, float b) { return x; } +double clampd(double x, double a, double b) { + if (x < a) return a; + if (x > b) return b; + return x; +} + int clampi(int x, int a, int b) { if (x < a) return a; if (x > b) return b; |