]> git.sur5r.net Git - i3/i3/commitdiff
truncate DPI to an integer before multiplying (Thanks eeemsi)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 26 Apr 2014 20:50:31 +0000 (22:50 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 26 Apr 2014 20:50:31 +0000 (22:50 +0200)
This fixes i3bar workspace button rendering on non-DPI screens
(oldschool!)

libi3/dpi.c

index c015065ba404f631d61b11e522398c56fa2b179b..5fd4cbca3a02916f2e6f5c1bbbe5b28295138028 100644 (file)
@@ -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);
 }