From b28cda2ac69326d5abf0a06757c2b5f9b29bc88c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 24 Jul 2015 01:52:51 +0200 Subject: [PATCH] beautiful.xresources.apply_dpi: use `math.ceil` Closes https://github.com/awesomeWM/awesome/pull/330. --- lib/awful/tooltip.lua | 4 ++-- lib/beautiful/xresources.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/awful/tooltip.lua b/lib/awful/tooltip.lua index cb490c5e2..802f0bd90 100644 --- a/lib/awful/tooltip.lua +++ b/lib/awful/tooltip.lua @@ -244,8 +244,8 @@ tooltip.new = function(args) self.background:set_fg(fg) -- Add margin. - local m_lr = args.margin_leftright or math.ceil(dpi(5)) - local m_tb = args.margin_topbottom or math.ceil(dpi(3)) + local m_lr = args.margin_leftright or dpi(5) + local m_tb = args.margin_topbottom or dpi(3) self.marginbox = wibox.layout.margin(self.background, m_lr, m_lr, m_tb, m_tb) self.wibox:set_widget(self.marginbox) diff --git a/lib/beautiful/xresources.lua b/lib/beautiful/xresources.lua index 5a41a4586..7f1766fe8 100644 --- a/lib/beautiful/xresources.lua +++ b/lib/beautiful/xresources.lua @@ -91,9 +91,9 @@ end --- Compute resulting size applying current DPI value (optionally per screen). -- @tparam number size Size -- @tparam[opt] integer s The screen. --- @treturn number Resulting size +-- @treturn integer Resulting size (using `math.ceil`). function xresources.apply_dpi(size, s) - return size/96*xresources.get_dpi(s) + return math.ceil(size/96*xresources.get_dpi(s)) end return xresources