summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/accessibility')
-rw-r--r--src/com/android/settings/accessibility/CaptionPropertiesFragment.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index fa664bbbd..9822fc39d 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -206,7 +206,10 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment
final ContentResolver cr = context.getContentResolver();
final float fontScale = manager.getFontScale();
if (previewWindow != null) {
- previewText.setTextSize(previewWindow.getHeight() * LINE_HEIGHT_RATIO * fontScale);
+ // Assume the viewport is clipped with a 16:9 aspect ratio.
+ final float virtualHeight = Math.max(9 * previewWindow.getWidth(),
+ 16 * previewWindow.getHeight()) / 16.0f;
+ previewText.setTextSize(virtualHeight * LINE_HEIGHT_RATIO * fontScale);
} else {
final float textSize = context.getResources().getDimension(
R.dimen.caption_preview_text_size);