From bd2179d8aa37e6088f20faae08fd6564a33e18c1 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 29 Dec 2023 11:52:28 -0800 Subject: bugfix scenario: run without config file, quit, run again expected: font size remains the same on second run Before this commit it was increasing on each run. It turns out the font height that you pass into love.graphics.newFont() is not the result of font:getHeight(). --- source.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source.lua') diff --git a/source.lua b/source.lua index d6ea40f..14d7afc 100644 --- a/source.lua +++ b/source.lua @@ -126,7 +126,7 @@ function source.load_settings() if Show_log_browser_side then right = App.screen.width/2 - Margin_right end - Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), right, font, math.floor(settings.font_height*1.3)) + Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), right, font, font_height, math.floor(settings.font_height*1.3)) Editor_state.filename = settings.filename Editor_state.filename = basename(Editor_state.filename) -- migrate settings that used full paths; we now support only relative paths within the app if settings.cursors then @@ -154,7 +154,7 @@ function source.initialize_default_settings() local font_height = 20 local font = love.graphics.newFont(font_height) source.initialize_window_geometry() - Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), App.screen.width-Margin_right, font, math.floor(font_height*1.3)) + Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), App.screen.width-Margin_right, font, font_height, math.floor(font_height*1.3)) Editor_state.filename = 'run.lua' end -- cgit 1.4.1-2-gfad0