Skip to content

Commit

Permalink
try to fix background flash
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Man committed Jul 29, 2011
1 parent 26da54d commit ed6997a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -28,7 +28,7 @@ A widget is tagged by multiple strings. loveui widgets are tagged with their own
Every style has a "selector" - A string of tags separated by whitespace. The style will apply to widgets that contain all of the tags in side the "selector".

To add a style:
widget:1add(style1)
widget1:add(style1)

To remove,
widget1:remove(widget2)
Expand Down
2 changes: 1 addition & 1 deletion loveui/graphics/love.lua
Expand Up @@ -15,6 +15,7 @@ draw = love.graphics.draw
framebuffer = love.graphics.newFramebuffer
rendertarget = love.graphics.setRenderTarget
scissor = love.graphics.setScissor
getscissor = love.graphics.getScissor
newfont = love.graphics.newFont
text = love.graphics.print
time = love.timer.getTime
Expand All @@ -23,7 +24,6 @@ mouseheld = love.mouse.isDown
mousex = love.mouse.getX
mousey = love.mouse.getY


function font(...)
if ... then
if ... ~= love.graphics.getFont() then
Expand Down
9 changes: 9 additions & 0 deletions loveui/ui/context.lua
Expand Up @@ -121,6 +121,15 @@ function context:update(dt)
context.__super.update(self, dt)
end

function context:draw()
local l, t, w, h = getscissor()
context.__super.draw(self)
if l then
scissor(l, t, w, h)
else
scissor()
end
end

test("ui.context.mousepressed", function()
local c = context()
Expand Down
2 changes: 1 addition & 1 deletion loveui/ui/widget.lua
Expand Up @@ -694,7 +694,7 @@ end

function widget:keyreleased(key, unicode)
if key == "tab" then
if not self.focused then
if not self.focused or self.focused == self then
self:focus(self.content[1])
else
for i, v in ipairs(self.content) do
Expand Down

0 comments on commit ed6997a

Please sign in to comment.