beautiful.xresources.apply_dpi: use `math.ceil`

Closes https://github.com/awesomeWM/awesome/pull/330.
This commit is contained in:
Daniel Hahler 2015-07-24 01:52:51 +02:00
parent 1f3ad814c9
commit b28cda2ac6
2 changed files with 4 additions and 4 deletions

View File

@ -244,8 +244,8 @@ tooltip.new = function(args)
self.background:set_fg(fg) self.background:set_fg(fg)
-- Add margin. -- Add margin.
local m_lr = args.margin_leftright or math.ceil(dpi(5)) local m_lr = args.margin_leftright or dpi(5)
local m_tb = args.margin_topbottom or math.ceil(dpi(3)) 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.marginbox = wibox.layout.margin(self.background, m_lr, m_lr, m_tb, m_tb)
self.wibox:set_widget(self.marginbox) self.wibox:set_widget(self.marginbox)

View File

@ -91,9 +91,9 @@ end
--- Compute resulting size applying current DPI value (optionally per screen). --- Compute resulting size applying current DPI value (optionally per screen).
-- @tparam number size Size -- @tparam number size Size
-- @tparam[opt] integer s The screen. -- @tparam[opt] integer s The screen.
-- @treturn number Resulting size -- @treturn integer Resulting size (using `math.ceil`).
function xresources.apply_dpi(size, s) function xresources.apply_dpi(size, s)
return size/96*xresources.get_dpi(s) return math.ceil(size/96*xresources.get_dpi(s))
end end
return xresources return xresources