more precise name
This commit is contained in:
parent
2884f872d8
commit
a1da18c107
13
edit.lua
13
edit.lua
|
@ -333,13 +333,13 @@ function edit.keychord_pressed(State, chord, key)
|
|||
State.search_backup = {cursor={line=State.cursor1.line, pos=State.cursor1.pos}, screen_top={line=State.screen_top1.line, pos=State.screen_top1.pos}}
|
||||
assert(State.search_text == nil)
|
||||
elseif chord == 'C-=' then
|
||||
initialize_font_settings(State.font_height+2)
|
||||
edit.update_font_settings(State, State.font_height+2)
|
||||
Text.redraw_all(State)
|
||||
elseif chord == 'C--' then
|
||||
initialize_font_settings(State.font_height-2)
|
||||
edit.update_font_settings(State, State.font_height-2)
|
||||
Text.redraw_all(State)
|
||||
elseif chord == 'C-0' then
|
||||
initialize_font_settings(20)
|
||||
edit.update_font_settings(State, 20)
|
||||
Text.redraw_all(State)
|
||||
elseif chord == 'C-z' then
|
||||
for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
|
||||
|
@ -450,6 +450,13 @@ end
|
|||
function edit.key_released(State, key, scancode)
|
||||
end
|
||||
|
||||
function edit.update_font_settings(State, font_height)
|
||||
State.font_height = font_height
|
||||
love.graphics.setFont(love.graphics.newFont(Editor_state.font_height))
|
||||
State.line_height = math.floor(font_height*1.3)
|
||||
State.em = App.newText(love.graphics.getFont(), 'm')
|
||||
end
|
||||
|
||||
--== some methods for tests
|
||||
|
||||
Test_margin_left = 25
|
||||
|
|
7
main.lua
7
main.lua
|
@ -123,13 +123,6 @@ function App.resize(w, h)
|
|||
Last_resize_time = App.getTime()
|
||||
end
|
||||
|
||||
function initialize_font_settings(font_height)
|
||||
Editor_state.font_height = font_height
|
||||
love.graphics.setFont(love.graphics.newFont(Editor_state.font_height))
|
||||
Editor_state.line_height = math.floor(font_height*1.3)
|
||||
Editor_state.em = App.newText(love.graphics.getFont(), 'm')
|
||||
end
|
||||
|
||||
function App.filedropped(file)
|
||||
-- first make sure to save edits on any existing file
|
||||
if Editor_state.next_save then
|
||||
|
|
Loading…
Reference in New Issue