From 8d3c3c34161e40b54362019d231a12979953afc9 Mon Sep 17 00:00:00 2001 From: felixkrautschuk Date: Thu, 30 Oct 2025 01:01:33 +0100 Subject: [PATCH] fix(android): prevent clipped font icons on Android (#10858) --- packages/core/image-source/index.android.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/image-source/index.android.ts b/packages/core/image-source/index.android.ts index 224802877..cd4d7938f 100644 --- a/packages/core/image-source/index.android.ts +++ b/packages/core/image-source/index.android.ts @@ -181,13 +181,14 @@ export class ImageSource implements ImageSourceDefinition { const textBounds = new android.graphics.Rect(); paint.getTextBounds(source, 0, source.length, textBounds); - const textWidth = textBounds.width(); - const textHeight = textBounds.height(); + const padding = 1; + const textWidth = textBounds.width() + padding * 2; + const textHeight = textBounds.height() + padding * 2; if (textWidth > 0 && textHeight > 0) { const bitmap = android.graphics.Bitmap.createBitmap(textWidth, textHeight, android.graphics.Bitmap.Config.ARGB_8888); const canvas = new android.graphics.Canvas(bitmap); - canvas.drawText(source, -textBounds.left, -textBounds.top, paint); + canvas.drawText(source, -textBounds.left + padding, -textBounds.top + padding, paint); return new ImageSource(bitmap); }