mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-02 02:58:13 -05:00
Try to draw action icons of size 16, 24, 32. #803.
This commit is contained in:
parent
56db37d4d9
commit
a335a6d555
@ -34,19 +34,18 @@ drawIcon = (resultColor, profileColor) ->
|
||||
icon = iconCache[cacheKey]
|
||||
return icon if icon
|
||||
if not drawContext?
|
||||
drawContext =
|
||||
19: document.getElementById('canvas-icon').getContext('2d')
|
||||
38: document.getElementById('canvas-icon-2x').getContext('2d')
|
||||
for own size, ctx of drawContext
|
||||
ctx.scale(size * 1, size * 1)
|
||||
drawContext = document.getElementById('canvas-icon').getContext('2d')
|
||||
|
||||
icon = {}
|
||||
for own size, ctx of drawContext
|
||||
for size in [16, 24, 32]
|
||||
drawContext.scale(size, size)
|
||||
drawContext.clearRect(0, 0, 1, 1)
|
||||
if resultColor?
|
||||
drawOmega ctx, resultColor, profileColor
|
||||
drawOmega drawContext, resultColor, profileColor
|
||||
else
|
||||
drawOmega ctx, profileColor
|
||||
icon[size] = ctx.getImageData(0, 0, size * 1, size * 1)
|
||||
drawOmega drawContext, profileColor
|
||||
drawContext.setTransform(1, 0, 0, 1, 0, 0)
|
||||
icon[size] = drawContext.getImageData(0, 0, size, size)
|
||||
|
||||
return iconCache[cacheKey] = icon
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas-icon"></canvas>
|
||||
<canvas id="canvas-icon-2x"></canvas>
|
||||
<script src="js/log_error.js"></script>
|
||||
<script src="lib/FileSaver/FileSaver.js"></script>
|
||||
<script src="js/background_preload.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user