213 {
214
215
216 if (kEmpty_State == fState) {
217 return;
218 }
219
220 int index = this->findRec(owner);
221 if (index < 0) {
222 SkDebugf(
"---- ignoring move without begin\n");
223 return;
224 }
225
226 Rec& rec = fTouches[index];
227
228
229 if (fTouches.
size() == 2) {
231
232 return;
233 }
234 }
235
236 rec.fPrevX = rec.fLastX; rec.fLastX =
x;
237 rec.fPrevY = rec.fLastY; rec.fLastY =
y;
238 rec.fPrevT = rec.fLastT;
240
241 switch (fTouches.
size()) {
242 case 1: {
243 float dx = rec.fLastX - rec.fStartX;
244 float dy = rec.fLastY - rec.fStartY;
248 } break;
249 case 2: {
251 const Rec& rec0 = fTouches[0];
252 const Rec& rec1 = fTouches[1];
253
254 float scale = this->computePinch(rec0, rec1);
256 center(rec0.fStartX, rec1.fStartX),
257 center(rec0.fStartY, rec1.fStartY),
258 center(rec0.fLastX, rec1.fLastX),
259 center(rec0.fLastY, rec1.fLastY));
260 } break;
261 default:
262 break;
263 }
264}
#define sk_float_round2int(x)
static SkScalar center(float pos0, float pos1)
static bool close_enough_for_jitter(float x0, float y0, float x1, float y1)
SkMatrix & setTranslate(SkScalar dx, SkScalar dy)
void updateZoom(float scale, float startX, float startY, float lastX, float lastY)