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

Function getMultiCenter

js/mui.gestures.js:177–199  ·  view source on GitHub ↗
(touches)

Source from the content-addressed store, hash-verified

175 return results;
176 };
177 var getMultiCenter = function(touches) {
178 var touchesLength = touches.length;
179 if (touchesLength === 1) {
180 return {
181 x: round(touches[0].pageX),
182 y: round(touches[0].pageY)
183 };
184 }
185
186 var x = 0;
187 var y = 0;
188 var i = 0;
189 while (i < touchesLength) {
190 x += touches[i].pageX;
191 y += touches[i].pageY;
192 i++;
193 }
194
195 return {
196 x: round(x / touchesLength),
197 y: round(y / touchesLength)
198 };
199 };
200 var multiTouch = function() {
201 return $.options.gestureConfig.pinch;
202 };

Callers 2

copySimpleTouchDataFunction · 0.70
calTouchDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected