MCPcopy Create free account
hub / github.com/google/pprof / handleTouchStart

Function handleTouchStart

internal/driver/html/common.js:151–172  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

149 }
150
151 function handleTouchStart(e) {
152 if (mode == IDLE && e.changedTouches.length == 1) {
153 // Start touch based panning
154 const t = e.changedTouches[0];
155 setMode(TOUCHPAN);
156 touchid = t.identifier;
157 panStart(t.clientX, t.clientY);
158 e.preventDefault();
159 } else if (mode == TOUCHPAN && e.touches.length == 2) {
160 // Start pinch zooming
161 setMode(TOUCHZOOM);
162 const t1 = e.touches[0];
163 const t2 = e.touches[1];
164 touchid = t1.identifier;
165 touchid2 = t2.identifier;
166 initScale = currentScale;
167 initGap = touchGap(t1, t2);
168 centerPoint = toSvg((t1.clientX + t2.clientX) / 2,
169 (t1.clientY + t2.clientY) / 2);
170 e.preventDefault();
171 }
172 }
173
174 function handleTouchMove(e) {
175 if (mode == TOUCHPAN) {

Callers

nothing calls this directly

Calls 4

setModeFunction · 0.85
panStartFunction · 0.85
touchGapFunction · 0.85
toSvgFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…