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

Function getScale

docs/app/js/sanddance-app.js:93054–93056  ·  view source on GitHub ↗

* calculate the scale factor between two pointersets * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out * @param {Array} start array of pointers * @param {Array} end array of pointers * @return {Number} scale

(start, end)

Source from the content-addressed store, hash-verified

93052 * @param {Array} end array of pointers
93053 * @return {Number} scale
93054 */ function getScale(start, end) {
93055 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
93056 }
93057 var MOUSE_INPUT_MAP = {
93058 mousedown: INPUT_START,
93059 mousemove: INPUT_MOVE,

Callers 10

computeInputDataFunction · 0.70
geoMethodFunction · 0.70
bandwidthFunction · 0.70
copyFunction · 0.70
domainFunction · 0.70
invertFunction · 0.70
rangeFunction · 0.70
scaleFunction · 0.70
scaleGradientFunction · 0.70
geoShapeFunction · 0.70

Calls 1

getDistanceFunction · 0.70

Tested by

no test coverage detected