Index: samplecode/SampleQuadStroker.cpp |
diff --git a/samplecode/SampleQuadStroker.cpp b/samplecode/SampleQuadStroker.cpp |
index 73373a2c979f415e14e573743c147e65f21b7372..05b6204026bb9a3e18fbd1dac3d936160e1bea78 100644 |
--- a/samplecode/SampleQuadStroker.cpp |
+++ b/samplecode/SampleQuadStroker.cpp |
@@ -304,10 +304,10 @@ protected: |
void draw_stroke(SkCanvas* canvas, const SkPath& path, SkScalar width, SkScalar scale, |
bool drawText) { |
- SkRect bounds = path.getBounds(); |
- if (bounds.isEmpty()) { |
+ if (path.isEmpty()) { |
return; |
} |
+ SkRect bounds = path.getBounds(); |
this->setWHZ(SkScalarCeilToInt(bounds.right()), drawText |
? SkScalarRoundToInt(scale * 3 / 2) : SkScalarRoundToInt(scale), |
SkScalarRoundToInt(950.0f / scale)); |