Ignore small text sizes in the text bounding assert.

Seems we sometimes give back unduely large metrics for 0 text size.

BUG=skia:2862
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/498503003
This commit is contained in:
mtklein 2014-08-21 14:46:49 -07:00 committed by Commit bot
parent 892f31ab08
commit d13291a5a3

View File

@ -326,7 +326,9 @@ private:
correct.fTop += metrics.fTop;
correct.fRight += metrics.fXMax;
correct.fBottom += metrics.fBottom;
SkASSERTF(rect->contains(correct), "%f %f %f %f vs. %f %f %f %f\n",
// See skia:2862 for why we ignore small text sizes.
SkASSERTF(paint.getTextSize() < 0.001f || rect->contains(correct),
"%f %f %f %f vs. %f %f %f %f\n",
-xPad, -yPad, +xPad, +yPad,
metrics.fXMin, metrics.fTop, metrics.fXMax, metrics.fBottom);
#endif