import { TNSPath2DBase } from './canvas-plugin.common' ; import { TNSDOMMatrix } from './TNSDOMMatrix' ; export class TNSPath2D extends TNSPath2DBase { constructor ( instance ? ) { let nativeInstance ; if ( typeof instance === 'string' ) { nativeInstance = new com . github . triniwiz . canvas . CanvasPath2D ( instance ) ; } else if ( instance instanceof TNSPath2D ) { nativeInstance = new com . github . triniwiz . canvas . CanvasPath2D ( instance . native ) ; } else if ( instance instanceof com . github . triniwiz . canvas . CanvasPath2D ) { nativeInstance = new com . github . triniwiz . canvas . CanvasPath2D ( instance ) ; } else { nativeInstance = new com . github . triniwiz . canvas . CanvasPath2D ( ) ; } super ( nativeInstance ) ; } addPath ( path , transform ? ) { if ( transform ) { this . nativeInstance . addPath ( path . nativeInstance , transform . native ) ; } else { this . nativeInstance . addPath ( path . nativeInstance , null ) ; } } arc ( x , y , radius , startAngle , endAngle , anticlockwise = false ) { this . nativeInstance . arc ( x , y , radius , startAngle , endAngle , anticlockwise ) ; } arcTo ( x1 , y1 , x2 , y2 , radius ) { this . nativeInstance . arcTo ( x1 , y1 , x2 , y2 , radius ) ; } bezierCurveTo ( cp1x , cp1y , cp2x , cp2y , x , y ) { this . nativeInstance . bezierCurveTo ( cp1x , cp1y , cp2x , cp2y , x , y ) ; } closePath ( ) { this . nativeInstance . closePath ( ) ; } ellipse ( x , y , radiusX , radiusY , rotation , startAngle , endAngle , anticlockwise = false ) { this . nativeInstance . ellipse ( x , y , radiusX , radiusY , rotation , startAngle , endAngle , anticlockwise ) ; } lineTo ( x , y ) { this . nativeInstance . lineTo ( x , y ) ; } moveTo ( x , y ) { this . nativeInstance . moveTo ( x , y ) ; } quadraticCurveTo ( cpx , cpy , x , y ) { this . nativeInstance . quadraticCurveTo ( cpx , cpy , x , y ) ; } rect ( x , y , width , height ) { this . nativeInstance . rect ( x , y , width , height ) ; } }