We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d03004 commit 34e8f7fCopy full SHA for 34e8f7f
src/ui-canvas/canvas.android.ts
@@ -193,8 +193,12 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
193
if (paint) {
194
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);
+ const original = this.mNative.getTypeface();
+ if (original) {
198
+ const style = original.getStyle();
199
+ const cloned = android.graphics.Typeface.create(original, style);
200
+ this.mNative.setTypeface(cloned);
201
+ }
202
} else {
203
this.mNative = new android.graphics.Paint(1); //android.graphics.Paint.ANTI_ALIAS_FLAG
204
}
0 commit comments