Merge text.love

[?]
Mar 19, 2023, 7:04 AM
QF3HGULONECPRBR4K4IEA5TQQLCIPQWADAKXNSPFQFBPOEK5A4LQC

Dependencies

Change contents

  • file deletion: source.lua (----------)source.lua (----------)
    [4.2][4.177715:177749](),[4.2][4.177715:177749](),[4.177749][4.165829:165829]()
    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 mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
    -- maximize window
    -- 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)
    end
    function source.initialize_default_settings()
    local font_height = 20
    love.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)
    -- maximize window to determine maximum allowable dimensions
    App.screen.resize(0, 0) -- maximize
    Display_width, Display_height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
    App.screen.flags.resizable = true
    App.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)
    end
    function source.set_window_position_from_settings(settings)
    end
    end
    function 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 mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
    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_side
    local right = App.screen.width - Margin_right
    if Show_log_browser_side then
    right = App.screen.width/2 - Margin_right
    end
    Editor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))
    Editor_state.filename = settings.filename
  • file deletion: run.lua (----------)run.lua (----------)
    [4.2][4.183867:183898](),[4.2][4.183867:183898](),[4.183898][4.178107:178107]()
    Settings.x, Settings.y, Settings.displayindex = App.screen.position()
    end
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    end
    function run.resize(w, h)
    --? print(("Window resized to width: %d and height: %d."):format(w, h))
    App.screen.width, App.screen.height = w, h
    Text.redraw_all(Editor_state)
    Editor_state.selection1 = {} -- no support for shift drag while we're resizing
    Editor_state.right = App.screen.width-Margin_right
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)
    end
    App.screen.resize(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    -- shrink height slightly to account for window decoration
    App.screen.height = App.screen.height-100
    App.screen.width = 40*em_width
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(App.screen.width, 200)
    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 mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
    -- maximize window
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    App.screen.move(Settings.x, Settings.y, Settings.displayindex)
    Editor_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.filename
    Editor_state.screen_top1 = Settings.screen_top
    Editor_state.cursor1 = Settings.cursor
    end
    function run.initialize_default_settings()
    local font_height = 20
    love.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_height
    Editor_state.line_height = math.floor(font_height*1.3)
    Editor_state.em = em
    Settings = run.settings()
    end
    function run.initialize_window_geometry(em_width)
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
  • replacement in main.lua at line 72
    [4.52][4.3304:3384](),[4.3304][4.3304:3384]()
    App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
    [4.52]
    [4.3384]
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
  • replacement in main.lua at line 78
    [4.3728][4.3728:3805](),[4.3805][4.2557:2630]()
    love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
    love.window.setPosition(settings.x, settings.y, settings.displayindex)
    [4.3728]
    [4.3805]
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    App.screen.move(settings.x, settings.y, settings.displayindex)
  • edit in main.lua at line 98
    [4.4589]
    [4.4589]
    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 mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    return
    end
  • replacement in main.lua at line 106
    [4.4610][4.4610:4731]()
    love.window.setMode(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
    [4.4610]
    [4.4731]
    App.screen.resize(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
  • replacement in main.lua at line 114
    [4.137][4.5030:5107](),[4.5030][4.5030:5107]()
    love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
    [4.137]
    [4.5107]
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
  • replacement in main.lua at line 161
    [4.6223][4.6223:6276]()
    local x,y,displayindex = love.window.getPosition()
    [4.6223]
    [4.6276]
    local x,y,displayindex = App.screen.position()
  • edit in edit.lua at line 67
    [4.3539][4.3532:3633]()
    filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows