diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-22 22:10:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-22 22:10:20 +0000 |
commit | cdbcb3ecc78a48a62503c67b01a0e2322d07fe29 (patch) | |
tree | 47add987f3e18972a06d0a571de996f9639194e7 | |
parent | c83e352c18858b7fd5fad62b395e83d09a4feaa6 (diff) |
update
git-svn-id: http://skia.googlecode.com/svn/trunk@6039 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | samplecode/SampleFatBits.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/samplecode/SampleFatBits.cpp b/samplecode/SampleFatBits.cpp index 4d87a9cd55..07e5a32907 100644 --- a/samplecode/SampleFatBits.cpp +++ b/samplecode/SampleFatBits.cpp @@ -111,7 +111,8 @@ private: paint->setStrokeWidth(0); break; case kStroke_Style: - paint->setStrokeWidth(SK_Scalar1 + SK_Scalar1/500); + paint->setStrokeWidth(SK_Scalar1); +// paint->setStrokeWidth(SK_Scalar1 + SK_Scalar1/500); break; } paint->setAntiAlias(aa); @@ -243,8 +244,11 @@ void FatBits::drawLine(SkCanvas* canvas, SkPoint pts[]) { fInverse.mapPoints(pts, 2); if (fGrid) { - pts[0].set(SkScalarRoundToScalar(pts[0].fX), SkScalarRoundToScalar(pts[0].fY)); - pts[1].set(SkScalarRoundToScalar(pts[1].fX), SkScalarRoundToScalar(pts[1].fY)); + SkScalar dd = 0;//SK_Scalar1 / 50; + pts[0].set(SkScalarRoundToScalar(pts[0].fX) + dd, + SkScalarRoundToScalar(pts[0].fY) + dd); + pts[1].set(SkScalarRoundToScalar(pts[1].fX) + dd, + SkScalarRoundToScalar(pts[1].fY) + dd); } erase(fMinSurface); @@ -308,9 +312,9 @@ class DrawLineView : public SampleView { public: DrawLineView() { fFB.setWHZ(24, 16, 48); - fPts[0].set(32, 32); - fPts[1].set(32 * 5, 32 * 4); - fIsRect = true; + fPts[0].set(48, 48); + fPts[1].set(48 * 5, 48 * 4); + fIsRect = false; } void setStyle(FatBits::Style s) { @@ -372,7 +376,7 @@ protected: virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { SkPoint pt = { x, y }; int index = -1; - SkScalar tol = 8; + SkScalar tol = 12; if (fPts[0].equalsWithinTolerance(pt, tol)) { index = 0; } else if (fPts[1].equalsWithinTolerance(pt, tol)) { |