MCPcopy Index your code
hub / github.com/microsoft/SandDance / resizeImage

Function resizeImage

docs/app/js/sanddance-app.js:99385–99392  ·  view source on GitHub ↗
(ctx, imageData, width, height)

Source from the content-addressed store, hash-verified

99383 return Math.pow(2, Math.ceil(Math.log2(number)));
99384}
99385function 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}
99393function getIconId(icon) {
99394 return icon && (icon.id || icon.url);
99395}

Callers 1

_loopFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected