From: Michael Stapelberg Date: Sat, 26 Apr 2014 20:50:31 +0000 (+0200) Subject: truncate DPI to an integer before multiplying (Thanks eeemsi) X-Git-Tag: 4.8~63 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3760a48abe802ae897a3d3441fdeb7efd584d3f8;p=i3%2Fi3 truncate DPI to an integer before multiplying (Thanks eeemsi) This fixes i3bar workspace button rendering on non-DPI screens (oldschool!) --- diff --git a/libi3/dpi.c b/libi3/dpi.c index c015065b..5fd4cbca 100644 --- a/libi3/dpi.c +++ b/libi3/dpi.c @@ -10,7 +10,7 @@ extern xcb_screen_t *root_screen; * */ int logical_px(const int logical) { - const double dpi = (double)root_screen->height_in_pixels * 25.4 / - (double)root_screen->height_in_millimeters; + const int dpi = (double)root_screen->height_in_pixels * 25.4 / + (double)root_screen->height_in_millimeters; return ceil((dpi / 96.0) * logical); }