From 3f734cf1eb86fef82c7390df003124565b8a84c6 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 16 Jul 2023 15:07:41 -0400 Subject: initial draft of variable-width font handling --- util.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util.c') 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; -- cgit v1.2.3