add onSendClickToChildren to views, so a view can capture all clicks.
speedup some of the unittests that were too slow
minor cleanup in SkScan_Path, in prep for larger changes
git-svn-id: http://skia.googlecode.com/svn/trunk@426 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/OverView.cpp b/samplecode/OverView.cpp
index e2abec2..2ae2119 100644
--- a/samplecode/OverView.cpp
+++ b/samplecode/OverView.cpp
@@ -29,7 +29,11 @@
return this->INHERITED::onQuery(evt);
}
- virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
+ virtual bool onSendClickToChildren(SkScalar x, SkScalar y) {
+ return false;
+ }
+
+ virtual Click* onFindClickHandler(SkScalar x, SkScalar y) {
int ix = (int)(SkScalarDiv(x * N, W));
int iy = (int)(SkScalarDiv(y * N, H));
if (ix >= 0 && iy >= 0) {
@@ -88,4 +92,3 @@
return canvas;
}
-
diff --git a/samplecode/SamplePathClip.cpp b/samplecode/SamplePathClip.cpp
index ece64ae..a126cbf 100644
--- a/samplecode/SamplePathClip.cpp
+++ b/samplecode/SamplePathClip.cpp
@@ -119,9 +119,13 @@
SkIntToScalar(250), SkIntToScalar(400));
canvas->drawOval(oval, p);
}
-
+
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
- fCenter.set(x, y);
+ return new Click(this);
+ }
+
+ virtual bool onClick(Click* click) {
+ fCenter.set(click->fCurr.fX, click->fCurr.fY);
this->inval(NULL);
return NULL;
}