mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-02 11:08:13 -05:00
Log error when drawing icon once for debugging.
This commit is contained in:
parent
e0d400cc8f
commit
e8ad1a4a4b
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user