fix(android): font icons had incorrect fallback size (#9914)

This commit is contained in:
Dimitris-Rafail Katsampas
2022-05-20 01:12:03 +03:00
committed by Nathan Walker
parent b619c3a7f1
commit e8bed44f5b

View File

@@ -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);