diff options
author | Derek Sollenberger <djsollen@google.com> | 2012-01-04 13:45:59 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2012-01-04 13:45:59 -0500 |
commit | 37f5d360c42dc162f3c9fd5b30f064e714c9b91e (patch) | |
tree | 12e5fbefca115eec04116cceac1475740a977ede /src/core/SkPaint.cpp | |
parent | 3835dced6aa563021942c680d0e90574a58f5170 (diff) | |
download | external_skia-37f5d360c42dc162f3c9fd5b30f064e714c9b91e.zip external_skia-37f5d360c42dc162f3c9fd5b30f064e714c9b91e.tar.gz external_skia-37f5d360c42dc162f3c9fd5b30f064e714c9b91e.tar.bz2 |
Allow 0 pt fonts in SkPaint
This is equivalent to the change made upstream in Skia (r2961).
bug: 5800195
Change-Id: Iafaffd61b65aa0d7c3cae158bb82cc5a6d6e3b78
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 0cdd2e6..6dca1a8 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -305,7 +305,7 @@ void SkPaint::setTextAlign(Align align) { } void SkPaint::setTextSize(SkScalar ts) { - if (ts > 0) { + if (ts >= 0) { GEN_ID_INC_EVAL(ts != fTextSize); fTextSize = ts; } else { @@ -938,6 +938,13 @@ size_t SkPaint::breakText(const void* textD, size_t length, SkScalar maxWidth, return 0; } + if (0 == fTextSize) { + if (measuredWidth) { + *measuredWidth = 0; + } + return length; + } + SkASSERT(textD != NULL); const char* text = (const char*)textD; |