sokoban.love/0032-update_font_settings

13 lines
718 B
Plaintext

update_font_settings = function(font_height)
love.graphics.setFont(love.graphics.newFont(font_height))
Line_height = math.floor(love.graphics.getFont():getHeight()*1.3)
Line_number_padding = Line_number_width*App.width('m')
Menu_height = 5 + Line_height + 5
Menu_bottom = Menu_top + Menu_height
Current_pane.editor_state.top = Menu_bottom + 20
Current_pane.editor_state.left = Menu_left + 50 + Line_number_padding
Current_pane.editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)
Current_pane.editor_state.width = Current_pane.editor_state.right - Current_pane.editor_state.left
edit.update_font_settings(Current_pane.editor_state, font_height)
Text.redraw_all(Current_pane.editor_state)
end