resize handler
This commit is contained in:
parent
28f1e113a4
commit
d6abaaa582
|
@ -2,12 +2,14 @@ on.initialize = function()
|
|||
love.graphics.setFont(love.graphics.newFont(20))
|
||||
Line_height = math.floor(love.graphics.getFont():getHeight()*1.3)
|
||||
Line_number_padding = Line_number_width*App.width('m')
|
||||
Menu_left, Menu_top = love.window.getSafeArea()
|
||||
Menu_left, Menu_top, Safe_width, Safe_height = love.window.getSafeArea()
|
||||
Menu_height = 5 + Line_height + 5
|
||||
Menu_bottom = Menu_top + Menu_height
|
||||
Editor_state = edit.initialize_state(
|
||||
--[[top]] Menu_bottom + 20, --[[bottom]] App.screen.height/2-5,
|
||||
--[[left]] 100, --[[right]] 400,
|
||||
Menu_bottom + 20, -- top
|
||||
Safe_height/2-5, -- bottom
|
||||
100, -- left
|
||||
math.min(100+30*App.width('m'), Safe_width*2/3), -- right
|
||||
love.graphics.getFont():getHeight(), Line_height)
|
||||
Text.redraw_all(Editor_state)
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
Safe_width = 0
|
|
@ -0,0 +1 @@
|
|||
Safe_height = 0
|
|
@ -0,0 +1,6 @@
|
|||
on.resize = function()
|
||||
_, _, Safe_width, Safe_height = love.window.getSafeArea()
|
||||
Editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)
|
||||
Editor_state.width = Editor_state.right - Editor_state.left
|
||||
Text.redraw_all(Editor_state)
|
||||
end
|
Loading…
Reference in New Issue