Преглед изворни кода

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.
Alex Szpakowski пре 3 година
родитељ
комит
b54aaf65ca
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/modules/love/callbacks.lua

+ 1 - 1
src/modules/love/callbacks.lua

@@ -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