truncate DPI to an integer before multiplying (Thanks eeemsi)

This fixes i3bar workspace button rendering on non-DPI screens
(oldschool!)
This commit is contained in:
Michael Stapelberg 2014-04-26 22:50:31 +02:00
parent 350e2c5f55
commit 3760a48abe

View 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 /
const int dpi = (double)root_screen->height_in_pixels * 25.4 /
(double)root_screen->height_in_millimeters;
return ceil((dpi / 96.0) * logical);
}