Skip to content

Commit a544f90

Browse files
committed
fix: Paint antialias by default
1 parent c9fe361 commit a544f90

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/canvas.android.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ class Canvas extends ProxyClass<android.graphics.Canvas> {
273273
export class Paint extends ProxyClass<android.graphics.Paint> {
274274
mNative: android.graphics.Paint;
275275
mFontInternal: Font;
276-
mNeedsFontUpdate = false;
277-
handlesFont = false;
276+
mNeedsFontUpdate;
277+
handlesFont;
278278
getNative() {
279279
if (!this.handlesFont && this.mNeedsFontUpdate) {
280280
this.mNeedsFontUpdate = false;
@@ -287,7 +287,9 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
287287
constructor(paint?: Paint) {
288288
super();
289289
if (paint) {
290-
this.mNative = new android.graphics.Paint(paint?.getNative());
290+
this.mNative = new android.graphics.Paint(paint.getNative());
291+
} else {
292+
this.mNative = new android.graphics.Paint(1); //android.graphics.Paint.ANTI_ALIAS_FLAG
291293
}
292294
this.mNative.setLinearText(true); // ensure we are drawing fonts correctly
293295
return this;

src/canvas.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ export class Paint implements IPaint {
854854
strokeMiter = 0;
855855
strokeCap: Cap = Cap.BUT;
856856
strokeJoin: Join = Join.BEVEL;
857-
antiAlias;
857+
antiAlias = true;
858858
dither;
859859
alpha = 255;
860860
currentContext: any;

0 commit comments

Comments
 (0)