From ae69b2db0333c7a8153d4478052db1fa3a95e931 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 5 Jan 2013 20:50:17 +0100 Subject: [PATCH] wibox.layout.base: Use math.min/max Signed-off-by: Uli Schlachter --- lib/wibox/layout/base.lua.in | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/wibox/layout/base.lua.in b/lib/wibox/layout/base.lua.in index f4758589..0d7e787b 100644 --- a/lib/wibox/layout/base.lua.in +++ b/lib/wibox/layout/base.lua.in @@ -7,6 +7,8 @@ local pairs = pairs local pcall = pcall local print = print +local min = math.min +local max = math.max -- wibox.layout.base local base = {} @@ -14,15 +16,6 @@ local base = {} --- Figure out the geometry in device coordinate space. This will break if -- someone rotates the coordinate space by a non-multiple of 90°. function base.rect_to_device_geometry(cr, x, y, width, height) - local function min(a, b) - if a < b then return a end - return b - end - local function max(a, b) - if a > b then return a end - return b - end - local x1, y1 = cr:user_to_device(x, y) local x2, y2 = cr:user_to_device(x + width, y + height) local x = min(x1, x2) -- 2.11.4.GIT