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

Function getScale

docs/tests/v2/es6/js/sanddance.js:52131–52133  ·  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

52129
52130
52131 function getScale(start, end) {
52132 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
52133 }
52134
52135 var MOUSE_INPUT_MAP = {
52136 mousedown: INPUT_START,

Callers 8

computeInputDataFunction · 0.70
rangeFunction · 0.70
domainFunction · 0.70
bandwidthFunction · 0.70
copyFunction · 0.70
scaleFunction · 0.70
invertFunction · 0.70
_defaultFunction · 0.70

Calls 1

getDistanceFunction · 0.70

Tested by

no test coverage detected