aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 80bb4a7..f9e00f2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -214,6 +214,16 @@ bool iszero(const void *ptr, size_t size)
return true;
}
+void render_capsule(cairo_t *cr, int x, int y, int w, int r1, int r2)
+{
+ const double degree = M_PI / 180.0;
+
+ cairo_new_sub_path(cr);
+ cairo_arc(cr, x + r1, y + r1, r2, 90 * degree, 270 * degree);
+ cairo_arc(cr, x + w - r1, y + r1, r2, 270 * degree, 450 * degree);
+ cairo_close_path(cr);
+}
+
int snprintf_units(char *buffer, size_t max, uint64_t bytes, unit_t unit)
{
int base = unit & UNIT_SI ? 1000 : 1024;