summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-16 15:07:41 -0400
committerpommicket <pommicket@gmail.com>2023-07-19 19:02:27 -0400
commit50692503702b9d419de99c97cff59a970627de01 (patch)
treedac844d3ac73f0f70542ec14de137b168b27dbd0 /util.c
parent817797e124419e564b1084c332540a222907f5a5 (diff)
initial draft of variable-width font handling
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util.c b/util.c
index f441479..02c5fc7 100644
--- a/util.c
+++ b/util.c
@@ -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;