Fix the default error handler drawing when love.graphics is inactive.

love.graphics.isActive() is false on mobile devices when the app isn't in the foreground. On iOS there can be a few frames between when the app is backgrounded and when the OS pauses it, where it's not valid to call OpenGL functions or present the screen.
This commit is contained in:
Alex Szpakowski
2021-12-04 11:58:00 -04:00
parent c35b1515ca
commit b54aaf65ca
+1 -1
View File
@@ -259,6 +259,7 @@ function love.errhand(msg)
p = p:gsub("%[string \"(.-)\"%]", "%1")
local function draw()
if not love.graphics.isActive() then return end
local pos = 70
love.graphics.clear(89/255, 157/255, 220/255)
love.graphics.printf(p, pos, pos, love.graphics.getWidth() - pos)
@@ -270,7 +271,6 @@ function love.errhand(msg)
if not love.system then return end
love.system.setClipboardText(fullErrorText)
p = p .. "\nCopied to clipboard!"
draw()
end
if love.system then