diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-04-01 16:29:17 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-04-01 18:12:29 -0700 |
commit | 876d6298b40fc8b00bf559d4ec2d909ab1e6bc80 (patch) | |
tree | 8a949ceac0f9c6010a6de42518683ba9b75a3450 /source.lua | |
parent | 4ab901c92e11f47828bc7f5f16d8d2250812d53f (diff) | |
download | view.love-876d6298b40fc8b00bf559d4ec2d909ab1e6bc80.tar.gz |
App.width can no longer take a Text
In the process I discovered the horrible fact that Text.x allocates a new Text. And it gets called (just once, thank goodness) on every single frame.
Diffstat (limited to 'source.lua')
-rw-r--r-- | source.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source.lua b/source.lua index bc2b1c5..3531bbf 100644 --- a/source.lua +++ b/source.lua @@ -162,13 +162,11 @@ 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)) + source.initialize_window_geometry(App.width('m')) Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right) Editor_state.filename = 'run.lua' Editor_state.font_height = font_height Editor_state.line_height = math.floor(font_height*1.3) - Editor_state.em = em end function source.initialize_window_geometry(em_width) |