Merge text.love

[?]
Jul 11, 2023, 1:41 AM
FM5LDKGT3WB343RD2HV7NTE4CGTMC77BTQNAQ5OSDPXD2PEWKWBAC

Dependencies

Change contents

  • file deletion: source_tests.lua (----------)source_tests.lua (----------)
    [4.2][4.150262:150302](),[4.2][4.150262:150302](),[4.150302][4.147166:147166]()
    function test_show_log_browser_side_splits_window_width()
    -- initialize screen dimensions and indicate that it is maximized
    App.screen.init{width=300, height=300}
  • file deletion: source.lua (----------)source.lua (----------)
    [4.2][4.177715:177749](),[4.2][4.177715:177749](),[4.177749][4.165829:165829]()
    Editor_state.right = App.screen.width - Margin_right
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.redraw_all(Editor_state)
    end
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.redraw_all(Editor_state)
    Log_browser_state.left = App.screen.width/2 + Margin_left
    Log_browser_state.right = App.screen.width - Margin_right
    if Settings == nil then Settings = {} end
    if Settings.source == nil then Settings.source = {} end
    Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
    File_navigation.cursors[Editor_state.filename] = {cursor1=Editor_state.cursor1, screen_top1=Editor_state.screen_top1}
    -- Initialize window width/height and make window resizable.
    --
    -- I get tempted to have opinions about window dimensions here, but they're
    -- non-portable:
    -- - maximizing doesn't work on mobile and messes things up
    -- - maximizing keeps the title bar on screen in Linux, but off screen on
    -- Windows. And there's no way to get the height of the title bar.
    -- It seems more robust to just follow LÖVE's default window size until
    -- someone overrides it.
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    App.screen.flags.resizable = true
    if os == 'Linux' then
    -- 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)
    else
    App.screen.move(settings.x, settings.y, settings.displayindex)
    end
    function source.set_window_position_from_settings(settings)
    local os = love.system.getOS()
    -- set up desired window dimensions and make window resizable
    _, _, App.screen.flags = App.screen.size()
    App.screen.flags.resizable = true
    App.screen.width, App.screen.height = settings.width, settings.height
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    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]()
    if Settings == nil then Settings = {} end
    Settings.x, Settings.y, Settings.displayindex = App.screen.position()
    return {
    -- Initialize window width/height and make window resizable.
    --
    -- I get tempted to have opinions about window dimensions here, but they're
    -- non-portable:
    -- - maximizing doesn't work on mobile and messes things up
    -- - maximizing keeps the title bar on screen in Linux, but off screen on
    -- Windows. And there's no way to get the height of the title bar.
    -- It seems more robust to just follow LÖVE's default window size until
    -- someone overrides it.
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    function run.set_window_position_from_settings(settings)
    local os = love.system.getOS()
    if os == 'Linux' then
    -- 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)
    else
    App.screen.move(settings.x, settings.y, settings.displayindex)
    end
    end
    function run.initialize_default_settings()
    local font_height = 20
    love.graphics.setFont(love.graphics.newFont(font_height))
    run.set_window_position_from_settings(Settings)
    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
    -- set up desired window dimensions and make window resizable
    _, _, App.screen.flags = App.screen.size()
    App.screen.flags.resizable = true
  • replacement in main.lua at line 89
    [4.3241][4.8:52](),[4.52][4.8:84](),[4.84][4.3384:3422](),[4.3384][4.3384:3422]()
    -- determine default dimensions and flags
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    -- set up desired window dimensions
    [4.3241]
    [4.3495]
    -- set up desired window dimensions and make window resizable
    _, _, App.screen.flags = App.screen.size()
  • edit in main.lua at line 92
    [4.3531][4.3531:3593](),[4.3593][4.8:72]()
    App.screen.flags.minwidth = math.min(App.screen.width, 200)
    App.screen.flags.minheight = math.min(App.screen.height, 200)
  • replacement in main.lua at line 94
    [4.160][4.160:225]()
    App.screen.move(settings.x, settings.y, settings.displayindex)
    [4.160]
    [4.3805]
    set_window_position_from_settings(settings)
  • edit in main.lua at line 101
    [4.4099]
    [4.4099]
    function set_window_position_from_settings(settings)
    local os = love.system.getOS()
    if os == 'Linux' then
    -- 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)
    else
    App.screen.move(settings.x, settings.y, settings.displayindex)
    end
    end
  • replacement in main.lua at line 121
    [4.4589][4.226:550](),[4.550][4.4589:4610](),[4.4589][4.4589:4610](),[4.4610][4.551:590]()
    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(0, 0) -- maximize
    [4.4589]
    [4.590]
    -- Initialize window width/height and make window resizable.
    --
    -- I get tempted to have opinions about window dimensions here, but they're
    -- non-portable:
    -- - maximizing doesn't work on mobile and messes things up
    -- - maximizing keeps the title bar on screen in Linux, but off screen on
    -- Windows. And there's no way to get the height of the title bar.
    -- It seems more robust to just follow LÖVE's default window size until
    -- someone overrides it.
  • edit in main.lua at line 131
    [4.666][4.4731:4869](),[4.4731][4.4731:4869]()
    -- shrink height slightly to account for window decoration
    App.screen.height = App.screen.height-100
    App.screen.width = 40*em_width
  • edit in main.lua at line 132
    [4.4905][4.4905:4967](),[4.4967][4.73:137]()
    App.screen.flags.minwidth = math.min(App.screen.width, 200)
    App.screen.flags.minheight = math.min(App.screen.height, 200)