Skip to content

Commit

Permalink
fix(android): font icons had incorrect fallback size (#9914)
Browse files Browse the repository at this point in the history
  • Loading branch information
CatchABus authored and NathanWalker committed Jul 9, 2022
1 parent d8e9e8b commit 2d9c4f2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/core/image-source/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2d9c4f2

Please sign in to comment.