From fd4dedf1ac12126bc88a0579613ea462d768bfbf Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 19 Jul 2012 21:08:40 -0400 Subject: [PATCH] Bug 715179 - (8 of 8) Special cased the FontSizePreference dialog when given afont size of 0 twip. r=bnicholson --- mobile/android/base/FontSizePreference.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/FontSizePreference.java b/mobile/android/base/FontSizePreference.java index a368a57c9641..30f28b121bf5 100644 --- a/mobile/android/base/FontSizePreference.java +++ b/mobile/android/base/FontSizePreference.java @@ -222,7 +222,14 @@ class FontSizePreference extends DialogPreference { * invalidates the view. Does not update the font indices. */ private void updatePreviewFontSize(String twip) { - mPreviewFontView.setTextSize(PREVIEW_FONT_SIZE_UNIT, convertTwipStrToPT(twip)); + float pt = convertTwipStrToPT(twip); + // Android will not render a font size of 0 pt but for Gecko, 0 twip turns off font + // inflation. Thus we special case 0 twip to display a renderable font size. + if (pt == 0) { + mPreviewFontView.setTextSize(PREVIEW_FONT_SIZE_UNIT, 1); + } else { + mPreviewFontView.setTextSize(PREVIEW_FONT_SIZE_UNIT, pt); + } mPreviewFontView.scrollTo(0, 0); }