| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "SkView.h" | 8 #include "SkView.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 | 10 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 SkView::Click* SkView::findClickHandler(SkScalar x, SkScalar y, unsigned modi) { | 372 SkView::Click* SkView::findClickHandler(SkScalar x, SkScalar y, unsigned modi) { |
| 373 if (x < 0 || y < 0 || x >= fWidth || y >= fHeight) { | 373 if (x < 0 || y < 0 || x >= fWidth || y >= fHeight) { |
| 374 return nullptr; | 374 return nullptr; |
| 375 } | 375 } |
| 376 | 376 |
| 377 if (this->onSendClickToChildren(x, y, modi)) { | 377 if (this->onSendClickToChildren(x, y, modi)) { |
| 378 F2BIter iter(this); | 378 F2BIter iter(this); |
| 379 SkView* child; | 379 SkView* child; |
| 380 | 380 |
| 381 while ((child = iter.next()) != nullptr) | 381 while ((child = iter.next()) != nullptr) { |
| 382 { | |
| 383 SkPoint p; | 382 SkPoint p; |
| 383 #if 0 |
| 384 if (!child->globalToLocal(x, y, &p)) { | 384 if (!child->globalToLocal(x, y, &p)) { |
| 385 continue; | 385 continue; |
| 386 } | 386 } |
| 387 #else |
| 388 // the above seems broken, so just respecting fLoc for now <reed> |
| 389 p.set(x - child->fLoc.x(), y - child->fLoc.y()); |
| 390 #endif |
| 387 | 391 |
| 388 Click* click = child->findClickHandler(p.fX, p.fY, modi); | 392 Click* click = child->findClickHandler(p.fX, p.fY, modi); |
| 389 | 393 |
| 390 if (click) { | 394 if (click) { |
| 391 return click; | 395 return click; |
| 392 } | 396 } |
| 393 } | 397 } |
| 394 } | 398 } |
| 395 | 399 |
| 396 return this->onFindClickHandler(x, y, modi); | 400 return this->onFindClickHandler(x, y, modi); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 SkDebugf(" />\n"); | 838 SkDebugf(" />\n"); |
| 835 } | 839 } |
| 836 } | 840 } |
| 837 | 841 |
| 838 void SkView::dump(bool recurse) const | 842 void SkView::dump(bool recurse) const |
| 839 { | 843 { |
| 840 dumpview(this, 0, recurse); | 844 dumpview(this, 0, recurse); |
| 841 } | 845 } |
| 842 | 846 |
| 843 #endif | 847 #endif |
| OLD | NEW |