mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user