fix maxWidth when using linear-text
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 17 May 2010 14:15:14 +0000 (14:15 +0000)
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 17 May 2010 14:15:14 +0000 (14:15 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@565 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkPaint.cpp

index 3d85b8c839af3df613a8274edb46140c68b62c7e..da818c48c2472ddcbaa6af34a9fbba9f7a7d2220 100644 (file)
@@ -906,6 +906,7 @@ size_t SkPaint::breakText(const void* textD, size_t length, SkScalar maxWidth,
     if (this->isLinearText())
     {
         scale = fTextSize / kCanonicalTextSizeForPaths;
+        maxWidth = SkScalarMulDiv(maxWidth, kCanonicalTextSizeForPaths, fTextSize);
         // this gets restored by restore
         ((SkPaint*)this)->setTextSize(SkIntToScalar(kCanonicalTextSizeForPaths));
     }