Log error when drawing icon once for debugging.

This commit is contained in:
FelisCatus 2017-02-26 20:46:25 -05:00
parent e0d400cc8f
commit e8ad1a4a4b

View File

@ -29,6 +29,7 @@ Promise.onUnhandledRejectionHandled (promise) ->
iconCache = {} iconCache = {}
drawContext = null drawContext = null
drawError = null
drawIcon = (resultColor, profileColor) -> drawIcon = (resultColor, profileColor) ->
cacheKey = "omega+#{resultColor ? ''}+#{profileColor}" cacheKey = "omega+#{resultColor ? ''}+#{profileColor}"
icon = iconCache[cacheKey] icon = iconCache[cacheKey]
@ -47,7 +48,10 @@ drawIcon = (resultColor, profileColor) ->
drawOmega drawContext, profileColor drawOmega drawContext, profileColor
drawContext.setTransform(1, 0, 0, 1, 0, 0) drawContext.setTransform(1, 0, 0, 1, 0, 0)
icon[size] = drawContext.getImageData(0, 0, size, size) icon[size] = drawContext.getImageData(0, 0, size, size)
catch catch e
if not drawError?
drawError = e
Log.error(e)
icon = null icon = null
return iconCache[cacheKey] = icon return iconCache[cacheKey] = icon