rotate: Use the draw_widget() function

Without this, input handling is broken (draw_widget() registers each widget with
its position for input handling).

This also removes some unnecessary save()/restore() calls. Our caller (again
draw_widget()) already does that for us.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-07-06 13:09:13 +02:00
parent f571ba4140
commit 21d821a8dd
1 changed files with 1 additions and 5 deletions

View File

@ -28,7 +28,6 @@ end
function rotate.draw(layout, wibox, cr, width, height) function rotate.draw(layout, wibox, cr, width, height)
if not layout.widget then return { width = 0, height = 0 } end if not layout.widget then return { width = 0, height = 0 } end
cr:save()
local dir = layout:get_direction() local dir = layout:get_direction()
if dir == "west" then if dir == "west" then
@ -44,10 +43,7 @@ function rotate.draw(layout, wibox, cr, width, height)
-- Since we rotated, we might have to swap width and height. -- Since we rotated, we might have to swap width and height.
-- transform() does that for us. -- transform() does that for us.
layout.widget:draw(wibox, cr, transform(layout, width, height)) base.draw_widget(wibox, cr, layout.widget, 0, 0, transform(layout, width, height))
-- Undo the rotation and translation from above.
cr:restore()
end end
--- Fit this layout into the given area --- Fit this layout into the given area