@@ -121,10 +121,10 @@ function drawViewOnCanvas(canvas: android.graphics.Canvas, view: View, rect?: an
121121}
122122
123123class ProxyClass < T > {
124- _native : T ;
124+ mNative : T ;
125125 static augmentedMethods = [ ] ;
126126 getNative ( ) {
127- return this . _native ;
127+ return this . mNative ;
128128 }
129129 constructor ( ) {
130130 const proxy = new Proxy ( this , this ) ;
@@ -138,7 +138,7 @@ class ProxyClass<T> {
138138 const methodName = name ;
139139 for ( let index = 0 ; index < args . length ; index ++ ) {
140140 const element = args [ index ] ;
141- if ( element && element . _native ) {
141+ if ( element && element . mNative ) {
142142 args [ index ] = element . getNative ( ) ;
143143 } else if ( Array . isArray ( element ) ) {
144144 args [ index ] = arrayToNativeArray ( element ) ;
@@ -175,7 +175,7 @@ class Canvas extends ProxyClass<android.graphics.Canvas> {
175175 this . _shouldReleaseBitmap = true ;
176176 this . _bitmap = this . _bitmap . copy ( android . graphics . Bitmap . Config . ARGB_8888 , true ) ;
177177 }
178- this . _native = new android . graphics . Canvas ( this . _bitmap ) ;
178+ this . mNative = new android . graphics . Canvas ( this . _bitmap ) ;
179179 }
180180
181181 return this ;
@@ -222,23 +222,23 @@ class Canvas extends ProxyClass<android.graphics.Canvas> {
222222}
223223
224224export class Paint extends ProxyClass < android . graphics . Paint > {
225- _native : android . graphics . Paint ;
226- fontInternal : Font ;
227- _needsFontUpdate = false ;
225+ mNative : android . graphics . Paint ;
226+ mFontInternal : Font ;
227+ mNeedsFontUpdate = false ;
228228 handlesFont = false ;
229229 getNative ( ) {
230- if ( ! this . handlesFont && this . _needsFontUpdate ) {
231- this . _needsFontUpdate = false ;
230+ if ( ! this . handlesFont && this . mNeedsFontUpdate ) {
231+ this . mNeedsFontUpdate = false ;
232232 const font = this . font ;
233233 const nTypeface = font . getAndroidTypeface ( ) ;
234- this . _native . setTypeface ( nTypeface ) ;
234+ this . mNative . setTypeface ( nTypeface ) ;
235235 }
236- return this . _native ;
236+ return this . mNative ;
237237 }
238238 constructor ( ) {
239239 super ( ) ;
240- this . _native = new android . graphics . Paint ( ) ;
241- this . _native . setLinearText ( true ) ; // ensure we are drawing fonts correctly
240+ this . mNative = new android . graphics . Paint ( ) ;
241+ this . mNative . setLinearText ( true ) ; // ensure we are drawing fonts correctly
242242 return this ;
243243 }
244244 handleCustomMethods ( target , native , methodName : string , args : any [ ] ) : any {
@@ -251,27 +251,27 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
251251 args [ 0 ] = createColorParam ( args [ 0 ] ) ;
252252 } else if ( methodName === 'setTypeface' ) {
253253 if ( args [ 0 ] instanceof Font ) {
254- this . fontInternal = args [ 0 ] ;
254+ this . mFontInternal = args [ 0 ] ;
255255 } else {
256256 this . font [ '_typeface' ] = args [ 0 ] as android . graphics . Typeface ;
257257 }
258- this . _needsFontUpdate = true ;
259- return this . fontInternal ;
258+ this . mNeedsFontUpdate = true ;
259+ return this . mFontInternal ;
260260 }
261261 }
262262 setFont ( font : Font ) {
263- this . fontInternal = font ;
263+ this . mFontInternal = font ;
264264 if ( this . handlesFont ) {
265265 return ;
266266 }
267- this . _native . setTextSize ( font . fontSize ) ;
268- this . _needsFontUpdate = true ;
267+ this . mNative . setTextSize ( font . fontSize ) ;
268+ this . mNeedsFontUpdate = true ;
269269 }
270270 getFont ( ) {
271- if ( ! this . fontInternal ) {
272- this . fontInternal = Font . default ;
271+ if ( ! this . mFontInternal ) {
272+ this . mFontInternal = Font . default ;
273273 }
274- return this . fontInternal ;
274+ return this . mFontInternal ;
275275 }
276276 get font ( ) {
277277 return this . getFont ( ) ;
@@ -290,9 +290,9 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
290290 }
291291 setFontFamily ( familyName : string ) {
292292 if ( this . font . fontFamily !== familyName ) {
293- this . fontInternal = this . font . withFontFamily ( familyName ) ;
293+ this . mFontInternal = this . font . withFontFamily ( familyName ) ;
294294 if ( ! this . handlesFont ) {
295- this . _needsFontUpdate = true ;
295+ this . mNeedsFontUpdate = true ;
296296 }
297297 }
298298 }
@@ -301,9 +301,9 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
301301 }
302302 setFontWeight ( weight : FontWeight ) {
303303 if ( this . font . fontWeight !== weight ) {
304- this . fontInternal = this . font . withFontWeight ( weight ) ;
304+ this . mFontInternal = this . font . withFontWeight ( weight ) ;
305305 if ( ! this . handlesFont ) {
306- this . _needsFontUpdate = true ;
306+ this . mNeedsFontUpdate = true ;
307307 }
308308 }
309309 }
@@ -312,49 +312,49 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
312312 }
313313 setFontStyle ( style : FontStyle ) {
314314 if ( this . font . fontStyle !== style ) {
315- this . fontInternal = this . font . withFontStyle ( style ) ;
315+ this . mFontInternal = this . font . withFontStyle ( style ) ;
316316 if ( ! this . handlesFont ) {
317- this . _needsFontUpdate = true ;
317+ this . mNeedsFontUpdate = true ;
318318 }
319319 }
320320 }
321321 set color ( color ) {
322322 ( this as any ) . setColor ( color ) ;
323323 }
324324 set strokeWidth ( value : number ) {
325- this . _native . setStrokeWidth ( value ) ;
325+ this . mNative . setStrokeWidth ( value ) ;
326326 }
327327 set strokeCap ( value : number ) {
328- this . _native . setStrokeCap ( value ) ;
328+ this . mNative . setStrokeCap ( value ) ;
329329 }
330330 set strokeJoin ( value : number ) {
331- this . _native . setStrokeJoin ( value ) ;
331+ this . mNative . setStrokeJoin ( value ) ;
332332 }
333333 set style ( value : number ) {
334- this . _native . setStyle ( value ) ;
334+ this . mNative . setStyle ( value ) ;
335335 }
336336 set textSize ( value : number ) {
337- this . _native . setTextSize ( value ) ;
337+ this . mNative . setTextSize ( value ) ;
338338 }
339339 get textSize ( ) {
340340 return this . getTextSize ( ) ;
341341 }
342342 public getTextSize ( ) : number {
343- return this . _native . getTextSize ( ) ;
343+ return this . mNative . getTextSize ( ) ;
344344 }
345345 public setTypeface ( font : Font | android . graphics . Typeface ) : Font {
346346 if ( font instanceof Font ) {
347347 this . setFont ( font ) ;
348- return this . fontInternal ;
348+ return this . mFontInternal ;
349349 } else if ( font ) {
350- this . fontInternal [ '_typeface' ] = font ;
350+ this . mFontInternal [ '_typeface' ] = font ;
351351 } else {
352- this . fontInternal = null ;
352+ this . mFontInternal = null ;
353353 }
354354 if ( ! this . handlesFont ) {
355- this . _needsFontUpdate = true ;
355+ this . mNeedsFontUpdate = true ;
356356 }
357- return this . fontInternal ;
357+ return this . mFontInternal ;
358358 }
359359 set typeface ( typeface ) {
360360 this . setTypeface ( typeface ) ;
@@ -364,30 +364,30 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
364364export class DashPathEffect extends ProxyClass < android . graphics . DashPathEffect > {
365365 constructor ( intervals : number [ ] , phase : number ) {
366366 super ( ) ;
367- this . _native = new android . graphics . DashPathEffect ( arrayToNativeArray ( intervals ) , phase ) ;
367+ this . mNative = new android . graphics . DashPathEffect ( arrayToNativeArray ( intervals ) , phase ) ;
368368 return this ;
369369 }
370370}
371371
372372export class Path extends ProxyClass < com . akylas . canvas . CanvasPath > {
373373 constructor ( path ?: com . akylas . canvas . CanvasPath ) {
374374 super ( ) ;
375- this . _native = path ? new com . akylas . canvas . CanvasPath ( path ) : new com . akylas . canvas . CanvasPath ( ) ;
375+ this . mNative = path ? new com . akylas . canvas . CanvasPath ( path ) : new com . akylas . canvas . CanvasPath ( ) ;
376376 return this ;
377377 }
378378}
379379export class RadialGradient extends ProxyClass < android . graphics . RadialGradient > {
380380 constructor ( param0 : number , param1 : number , param2 : number , param3 : any , param4 : any , param5 : any ) {
381381 super ( ) ;
382- this . _native = new android . graphics . RadialGradient ( param0 , param1 , param2 , createColorParam ( param3 ) , param4 instanceof Array ? param4 : createColorParam ( param4 ) , param5 ) ;
382+ this . mNative = new android . graphics . RadialGradient ( param0 , param1 , param2 , createColorParam ( param3 ) , param4 instanceof Array ? param4 : createColorParam ( param4 ) , param5 ) ;
383383 return this ;
384384 }
385385}
386386
387387export class LinearGradient extends ProxyClass < android . graphics . LinearGradient > {
388- _native : android . graphics . LinearGradient ;
388+ mNative : android . graphics . LinearGradient ;
389389 getNative ( ) {
390- return this . _native ;
390+ return this . mNative ;
391391 }
392392 constructor ( param0 : number , param1 : number , param2 : number , param3 : any , param4 : any , param5 : any , param6 : any ) {
393393 super ( ) ;
@@ -409,19 +409,19 @@ export class LinearGradient extends ProxyClass<android.graphics.LinearGradient>
409409 param5 = createColorParam ( param5 ) ;
410410 }
411411 }
412- this . _native = new android . graphics . LinearGradient ( param0 , param1 , param2 , param3 , param4 , param5 , param6 ) ;
412+ this . mNative = new android . graphics . LinearGradient ( param0 , param1 , param2 , param3 , param4 , param5 , param6 ) ;
413413 return this ;
414414 }
415415}
416416
417417export class BitmapShader extends ProxyClass < android . graphics . BitmapShader > {
418- _native : android . graphics . BitmapShader ;
418+ mNative : android . graphics . BitmapShader ;
419419 constructor ( bitmap : any , tileX : any , tileY : any ) {
420420 super ( ) ;
421421 if ( bitmap instanceof ImageSource ) {
422422 bitmap = bitmap . android ;
423423 }
424- this . _native = new android . graphics . BitmapShader ( bitmap , tileX , tileY ) ;
424+ this . mNative = new android . graphics . BitmapShader ( bitmap , tileX , tileY ) ;
425425 return this ;
426426 }
427427}
@@ -435,7 +435,7 @@ export class StaticLayout extends ProxyClass<android.text.StaticLayout> {
435435 // in case it is a number or a boolean
436436 text = text + '' ;
437437 }
438- this . _native = com . akylas . canvas . StaticLayout . createStaticLayout ( text , paint , width , align , spacingmult , spacingadd , includepad ) ;
438+ this . mNative = com . akylas . canvas . StaticLayout . createStaticLayout ( text , paint , width , align , spacingmult , spacingadd , includepad ) ;
439439
440440 return this ;
441441 }
@@ -478,7 +478,7 @@ class CanvasView extends CanvasBase {
478478 }
479479 canvas . drawBitmap ( shapeCanvas . getImage ( ) as android . graphics . Bitmap , 0 , 0 , this . shapePaint ) ;
480480 } else if ( ! this . cached ) {
481- const shapes = this . _shapes ;
481+ const shapes = this . mShapes ;
482482 const width = canvas . getWidth ( ) ;
483483 const height = canvas . getHeight ( ) ;
484484 if ( shapes && shapes . length > 0 ) {
@@ -524,7 +524,7 @@ class CanvasView extends CanvasBase {
524524 canvas . save ( ) ;
525525 // canvas.setDensity(Math.round(scale * 160));
526526 canvas . scale ( scale , scale ) ; // always scale to device density to work with dp
527- this . augmentedCanvas . _native = canvas ;
527+ this . augmentedCanvas . mNative = canvas ;
528528 this . onDraw ( this . augmentedCanvas as any ) ;
529529 if ( drawFameRate ) {
530530 const end = Date . now ( ) ;
0 commit comments