From 779a4a9fbbf0dd398212ef774325025a4dbd61a0 Mon Sep 17 00:00:00 2001 From: Dimitris - Rafail Katsampas Date: Thu, 19 May 2022 18:23:30 +0300 Subject: [PATCH] fix(core): Font icons had incorrect fallback size in android. --- packages/core/image-source/index.android.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/core/image-source/index.android.ts b/packages/core/image-source/index.android.ts index 01070058d2..39458a717c 100644 --- a/packages/core/image-source/index.android.ts +++ b/packages/core/image-source/index.android.ts @@ -187,14 +187,12 @@ export class ImageSource implements ImageSourceDefinition { paint.setColor(color.android); } - let scaledFontSize = layout.toDevicePixels(font.fontSize); - if (!scaledFontSize) { - // TODO: Consider making 36 font size as default for optimal look on TabView and ActionBar - scaledFontSize = layout.toDevicePixels(paint.getTextSize()); + // TODO: Consider making 36 font size as default for optimal look on TabView and ActionBar + const scaledFontSize = layout.toDevicePixels(font.fontSize); + if (scaledFontSize) { + paint.setTextSize(scaledFontSize); } - paint.setTextSize(scaledFontSize); - const textBounds = new android.graphics.Rect(); paint.getTextBounds(source, 0, source.length, textBounds);