Allow zero text size to be specified for an SkPaint.
authorvandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 17 Nov 2010 21:44:28 +0000 (21:44 +0000)
committervandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 17 Nov 2010 21:44:28 +0000 (21:44 +0000)
We have to support zero sized fonts and generate correct metrics
to pass Acid3.  There don't seem to be any requirements that textsize
be >0, just that it not be negative.

Original issue: http://codereview.appspot.com/3174041/

Review URL: http://codereview.appspot.com/3176042

git-svn-id: http://skia.googlecode.com/svn/trunk@626 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkPaint.cpp

index 43a6892..88d924b 100644 (file)
@@ -276,11 +276,11 @@ void SkPaint::setTextAlign(Align align)
 
 void SkPaint::setTextSize(SkScalar ts)
 {
-    if (ts > 0)
+    if (ts >= 0)
         fTextSize = ts;
 #ifdef SK_DEBUG
     else
-        SkDebugf("SkPaint::setTextSize() called with non-positive value\n");
+        SkDebugf("SkPaint::setTextSize() called with negative value\n");
 #endif
 }