Skip to content

Commit 7ea421a

Browse files
authored
fix(android): clone typeface when cloning paint
1 parent ada7078 commit 7ea421a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ui-canvas/canvas.android.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
192192
super();
193193
if (paint) {
194194
this.mNative = new android.graphics.Paint(paint.getNative());
195+
//we need to clone the typeface or it is shared
196+
const nTypeface = paint.font.getAndroidTypeface();
197+
this.mNative.setTypeface(nTypeface);
195198
} else {
196199
this.mNative = new android.graphics.Paint(1); //android.graphics.Paint.ANTI_ALIAS_FLAG
197200
}

0 commit comments

Comments
 (0)