patch a vector for memory leaks
Multiple editors in an app shouldn't create duplicate font objects. Not strictly needed for this app, but feels hard-won enough I want to pull this in from Carousel to all forks. This still isn't ideal. Ideally we'd automatically share the font.
This commit is contained in:
parent
c064f0a97d
commit
8f88af234a
4
edit.lua
4
edit.lua
|
@ -537,9 +537,9 @@ end
|
|||
function edit.key_release(State, key, scancode)
|
||||
end
|
||||
|
||||
function edit.update_font_settings(State, font_height)
|
||||
function edit.update_font_settings(State, font_height, font)
|
||||
State.font_height = font_height
|
||||
State.font = love.graphics.newFont(State.font_height)
|
||||
State.font = font or love.graphics.newFont(State.font_height)
|
||||
State.line_height = math.floor(font_height*1.3)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue