JKENJ2UGUCIHH27LSUZLVZIYOTUR3JDWUG453OFYTRL3V3IRQGTAC 2TQUKHBC2EB3WDBD5UL62DQYV7CV6B7OJYK7CHOEDNOZENSOG42AC 5RDWSYK2YESTIEDMGOD2T7E4KCOA6DOM35ECMZT2XZT57JSCRJEQC 4J4TX7ISH3VIRSDYMGIJJ2WMTI2LPYJHFRWGGMXCEFTAYZOWXMAQC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC S3PNFXTB4EF4PR4RMDK3YX5HTBJP2U6GRBX5UWAMUFBC5CRPOWZAC UUTUPEOJQBLCXRTXHU6W2QNDH536RH5M3GO6GZGSDEH2GANCD2GQC U3MJNFUY4ER65BIKP4D7JGVYWFPXA55KBJYD4RH5KRRKRQXBAW5AC CQYKYJJU3NMY2CNXF7VZWSDYU3SWPFWA3ZHDW24Q4S6QEK5Y2TSAC EJOZAD7N3G5IIPRVRXV2T2JV36LAFNWHPL3TRBKAOIKT63M7FYRAC HCFDBUXHWT4IBY3QHR2LBN26L7LVCBZI6H353JE6W7QNLCEDCCCQC JOPVPUSAMMU6RFVDQR4NJC4GNNUFB7GPKVH7OS5FKCYS5QZ53VLQC AYX33NBCPCBFWEZI5KZXHP3Y2Q62GYVT4WHYJUYRIPYV67KPSYZAC ATQO62TFDZ7J4RCOSB3K2QCCB5R6PNYQIIGNXTLZMEFG5UG5PUJQC D76MS2G2IKXVXUUULUF7X26L35RSPYBDYYYZZOSBC3DPLOGXZ4BAC DCO5BQWVIAW3KDY3VUMKZPCPWAVZJSTZGNWU6CRY3I5FVLU76REQC DB7HJBHJ2ZB665YA4PDX5EXZKTUIYSXQ4CUMAK4HBCOT7G25EKXAC endfunction source.resize_window_from_settings(settings)-- maximize window to determine maximum allowable dimensionsApp.screen.resize(0, 0) -- maximizeDisplay_width, Display_height, App.screen.flags = App.screen.size()-- set up desired window dimensionsApp.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(Display_width, 200)App.screen.flags.minheight = math.min(Display_height, 200)App.screen.width, App.screen.height = settings.width, settings.height--? print('setting window from settings:', App.screen.width, App.screen.height)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)endfunction source.set_window_position_from_settings(settings)local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend-- maximize windowendfunction source.initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height))local em = App.newText(love.graphics.getFont(), 'm')source.initialize_window_geometry(App.width(em))Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)source.resize_window_from_settings(settings)--? print('loading source position', settings.x, settings.y, settings.displayindex)source.set_window_position_from_settings(settings)Show_log_browser_side = settings.show_log_browser_sidelocal right = App.screen.width - Margin_rightif Show_log_browser_side thenright = App.screen.width/2 - Margin_rightendEditor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))Editor_state.filename = settings.filename
Settings.x, Settings.y, Settings.displayindex = App.screen.position()endApp.screen.resize(App.screen.width, App.screen.height, App.screen.flags)endfunction run.resize(w, h)--? print(("Window resized to width: %d and height: %d."):format(w, h))App.screen.width, App.screen.height = w, hText.redraw_all(Editor_state)Editor_state.selection1 = {} -- no support for shift drag while we're resizingEditor_state.right = App.screen.width-Margin_rightEditor_state.width = Editor_state.right-Editor_state.leftText.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)endApp.screen.resize(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()-- shrink height slightly to account for window decorationApp.screen.height = App.screen.height-100App.screen.width = 40*em_widthApp.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(App.screen.width, 200)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)App.screen.move(Settings.x, Settings.y, Settings.displayindex)local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend-- maximize windowEditor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, Settings.font_height, math.floor(Settings.font_height*1.3))Editor_state.filename = Settings.filenameEditor_state.screen_top1 = Settings.screen_topEditor_state.cursor1 = Settings.cursorendfunction run.initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height))local em = App.newText(love.graphics.getFont(), 'm')run.initialize_window_geometry(App.width(em))Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)Editor_state.font_height = font_heightEditor_state.line_height = math.floor(font_height*1.3)Editor_state.em = emSettings = run.settings()endfunction run.initialize_window_geometry(em_width)App.screen.width, App.screen.height, App.screen.flags = App.screen.size()-- set up desired window dimensions
-- maximize window to determine maximum allowable dimensionsApp.screen.resize(0, 0) -- maximizeDisplay_width, Display_height, App.screen.flags = App.screen.size()-- set up desired window dimensionsApp.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(Display_width, 200)App.screen.flags.minheight = math.min(Display_height, 200)App.screen.width, App.screen.height = settings.width, settings.height--? print('setting window from settings:', App.screen.width, App.screen.height)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
source.resize_window_from_settings(settings)
endendfunction source.resize_window_from_settings(settings)local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()return
-- maximize window to determine maximum allowable dimensionsApp.screen.resize(0, 0) -- maximizeDisplay_width, Display_height, App.screen.flags = App.screen.size()-- set up desired window dimensionsApp.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(Display_width, 200)App.screen.flags.minheight = math.min(Display_height, 200)App.screen.width, App.screen.height = settings.width, settings.height--? print('setting window from settings:', App.screen.width, App.screen.height)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
-- setPosition doesn't quite seem to do what is asked of it on Linux.love.window.setPosition(settings.x, settings.y-37, settings.displayindex)
-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)
local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend
love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)love.window.setPosition(Settings.x, Settings.y, Settings.displayindex)
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)App.screen.move(Settings.x, Settings.y, Settings.displayindex)
local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend