MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / updateDetail

Function updateDetail

core/src/utils/gesture/index.ts:258–276  ·  view source on GitHub ↗
(ev: any, detail: GestureDetail)

Source from the content-addressed store, hash-verified

256};
257
258const updateDetail = (ev: any, detail: GestureDetail) => {
259 // get X coordinates for either a mouse click
260 // or a touch depending on the given event
261 let x = 0;
262 let y = 0;
263 if (ev) {
264 const changedTouches = ev.changedTouches;
265 if (changedTouches && changedTouches.length > 0) {
266 const touch = changedTouches[0];
267 x = touch.clientX;
268 y = touch.clientY;
269 } else if (ev.pageX !== undefined) {
270 x = ev.pageX;
271 y = ev.pageY;
272 }
273 }
274 detail.currentX = x;
275 detail.currentY = y;
276};
277
278const now = (ev: UIEvent) => {
279 return ev.timeStamp || Date.now();

Callers 2

pointerDownFunction · 0.85
calcGestureDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected