| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 scale = MAX_ZOOM_SCALE / curr; | 196 scale = MAX_ZOOM_SCALE / curr; |
| 197 } else if (scale < 1 && curr * scale < MIN_ZOOM_SCALE) { | 197 } else if (scale < 1 && curr * scale < MIN_ZOOM_SCALE) { |
| 198 scale = MIN_ZOOM_SCALE / curr; | 198 scale = MIN_ZOOM_SCALE / curr; |
| 199 } | 199 } |
| 200 return scale; | 200 return scale; |
| 201 } | 201 } |
| 202 | 202 |
| 203 void SkTouchGesture::touchMoved(void* owner, float x, float y) { | 203 void SkTouchGesture::touchMoved(void* owner, float x, float y) { |
| 204 // GrPrintf("--- %d touchMoved %p %g %g\n", fTouches.count(), owner, x, y); | 204 // GrPrintf("--- %d touchMoved %p %g %g\n", fTouches.count(), owner, x, y); |
| 205 | 205 |
| 206 SkASSERT(kEmpty_State != fState); | 206 if (kEmpty_State == fState) { |
| 207 return; |
| 208 } |
| 207 | 209 |
| 208 int index = this->findRec(owner); | 210 int index = this->findRec(owner); |
| 209 if (index < 0) { | 211 if (index < 0) { |
| 210 // not found, so I guess we should add it... | 212 // not found, so I guess we should add it... |
| 211 SkDebugf("---- add missing begin\n"); | 213 SkDebugf("---- add missing begin\n"); |
| 212 this->appendNewRec(owner, x, y); | 214 this->appendNewRec(owner, x, y); |
| 213 index = fTouches.count() - 1; | 215 index = fTouches.count() - 1; |
| 214 } | 216 } |
| 215 | 217 |
| 216 Rec& rec = fTouches[index]; | 218 Rec& rec = fTouches[index]; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 fTouches.reset(); | 320 fTouches.reset(); |
| 319 fState = kEmpty_State; | 321 fState = kEmpty_State; |
| 320 found = true; | 322 found = true; |
| 321 } | 323 } |
| 322 } | 324 } |
| 323 | 325 |
| 324 fLastUpT = now; | 326 fLastUpT = now; |
| 325 fLastUpP.set(x, y); | 327 fLastUpP.set(x, y); |
| 326 return found; | 328 return found; |
| 327 } | 329 } |
| OLD | NEW |