| 99383 | return Math.pow(2, Math.ceil(Math.log2(number))); |
| 99384 | } |
| 99385 | function resizeImage(ctx, imageData, width, height) { |
| 99386 | if (width === imageData.width && height === imageData.height) return imageData; |
| 99387 | ctx.canvas.height = height; |
| 99388 | ctx.canvas.width = width; |
| 99389 | ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); |
| 99390 | ctx.drawImage(imageData, 0, 0, imageData.width, imageData.height, 0, 0, width, height); |
| 99391 | return ctx.canvas; |
| 99392 | } |
| 99393 | function getIconId(icon) { |
| 99394 | return icon && (icon.id || icon.url); |
| 99395 | } |