context: Fix some regressions

This commit is contained in:
Emmanuel Lepage Vallee 2016-03-02 03:49:18 -05:00
parent f48ede52f9
commit d43e1170d1
2 changed files with 5 additions and 5 deletions

View File

@ -132,7 +132,7 @@ function module.get_relative_points(geo, mode)
left = {x = dgeo.x , y = center_point.y },
right = {x = dgeo.x + dgeo.width , y = center_point.y },
top = {x = center_point.x , y = dgeo.y },
bottom = {x = center_point.y , y = dgeo.y + dgeo.height },
bottom = {x = center_point.x , y = dgeo.y + dgeo.height },
}
local s = geo.drawable.screen or screen.getbycoord(
@ -188,7 +188,7 @@ function module.move_relative(d, points, preferred_positions)
end
-- No need to continue
if preferred_positions[k] == 1 then break end
if fit and preferred_positions[k] == 1 then break end
end
local pos_name = pref_name or next(does_fit)
@ -202,4 +202,4 @@ function module.move_relative(d, points, preferred_positions)
return pos_name
end
return module
return module

View File

@ -165,7 +165,7 @@ end
-- @param use_mouse Use the mouse position instead of the widget center as
-- reference point.
function wb_func:move_by_parent(geo, use_mouse)
local dps = placement.get_relative_points(d, rgeo, mode)
local dps = placement.get_relative_points(geo, mode)
rawset(self, "possible_positions", dps)
@ -234,4 +234,4 @@ local function create_auto_resize_widget(self, wdg, args)
return w
end
return setmetatable(module, {__call = create_auto_resize_widget})
return setmetatable(module, {__call = create_auto_resize_widget})