MCPcopy Create free account
hub / github.com/dcloudio/mui / getScale

Function getScale

js/mui.gestures.js:62–68  ·  view source on GitHub ↗
(starts, moves)

Source from the content-addressed store, hash-verified

60 * @param {Object} moves
61 */
62 var getScale = function(starts, moves) {
63 if (starts.length >= 2 && moves.length >= 2) {
64 var props = ['pageX', 'pageY'];
65 return getDistance(moves[1], moves[0], props) / getDistance(starts[1], starts[0], props);
66 }
67 return 1;
68 };
69 /**
70 * angle
71 * @param {type} p1

Callers 1

calTouchDataFunction · 0.70

Calls 1

getDistanceFunction · 0.70

Tested by

no test coverage detected