Simplified core.step()
This commit is contained in:
parent
31820b36ef
commit
22171fa802
|
@ -321,7 +321,6 @@ end
|
||||||
|
|
||||||
function core.step()
|
function core.step()
|
||||||
-- handle events
|
-- handle events
|
||||||
local event_count = 0
|
|
||||||
local did_keymap = false
|
local did_keymap = false
|
||||||
local mouse_moved = false
|
local mouse_moved = false
|
||||||
local mouse = { x = 0, y = 0, dx = 0, dy = 0 }
|
local mouse = { x = 0, y = 0, dx = 0, dy = 0 }
|
||||||
|
@ -336,7 +335,7 @@ function core.step()
|
||||||
else
|
else
|
||||||
did_keymap = core.on_event(type, a, b, c, d) or did_keymap
|
did_keymap = core.on_event(type, a, b, c, d) or did_keymap
|
||||||
end
|
end
|
||||||
event_count = event_count + 1
|
core.redraw = true
|
||||||
end
|
end
|
||||||
if mouse_moved then
|
if mouse_moved then
|
||||||
core.on_event("mousemoved", mouse.x, mouse.y, mouse.dx, mouse.dy)
|
core.on_event("mousemoved", mouse.x, mouse.y, mouse.dx, mouse.dy)
|
||||||
|
@ -347,9 +346,7 @@ function core.step()
|
||||||
-- update
|
-- update
|
||||||
core.root_view.size.x, core.root_view.size.y = width, height
|
core.root_view.size.x, core.root_view.size.y = width, height
|
||||||
core.root_view:update()
|
core.root_view:update()
|
||||||
if not (event_count > 0 or core.redraw) then
|
if not core.redraw then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
core.redraw = false
|
core.redraw = false
|
||||||
|
|
||||||
-- close unreferenced docs
|
-- close unreferenced docs
|
||||||
|
|
Loading…
Reference in New Issue