diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-12-27 15:14:37 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-01 20:09:34 +0000 |
| commit | 8b1e702827a0e710c7eaa52865c2ff680b8e6f19 (patch) | |
| tree | 74b5c8a1ceac568a2777051f5f0c1c6fd8e7a306 | |
| parent | macros: add CONST (__attribute((__const__))) (diff) | |
box-drawing: thickness(): tag as CONST, convert point-size to a float
| -rw-r--r-- | box-drawing.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/box-drawing.c b/box-drawing.c index dda9ea3c..e37cfbee 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -6,14 +6,15 @@ #define LOG_MODULE "box-drawing" #define LOG_ENABLE_DBG 1 #include "log.h" +#include "macros.h" #include "stride.h" #include "terminal.h" #include "xmalloc.h" -static int -thickness(int pts, int dpi) +static int CONST +thickness(float pts, int dpi) { - return pts * dpi / 72; + return pts * (float)dpi / 72.0; } static void |
