MCPcopy Create free account
hub / github.com/microsoft/SandDance / scaleX

Function scaleX

docs/app/js/sanddance-app.js:59444–59447  ·  view source on GitHub ↗
(x, ratio, width)

Source from the content-addressed store, hash-verified

59442 };
59443}
59444function scaleX(x, ratio, width) {
59445 var r = Math.min(Math.round(x * ratio), width - 1);
59446 return r;
59447}
59448function scaleY(y, ratio, height, yInvert) {
59449 return yInvert ? Math.max(0, height - 1 - Math.round(y * ratio)) : Math.min(Math.round(y * ratio), height - 1);
59450}

Callers 1

scalePixelsFunction · 0.70

Calls 1

minMethod · 0.45

Tested by

no test coverage detected