@@ -528,7 +528,10 @@ export class Matrix implements IMatrix {
528
528
529
529
export class PathEffect { }
530
530
export class DashPathEffect extends PathEffect {
531
- constructor ( public intervals : number [ ] , public phase : number ) {
531
+ constructor (
532
+ public intervals : number [ ] ,
533
+ public phase : number
534
+ ) {
532
535
super ( ) ;
533
536
}
534
537
}
@@ -634,6 +637,7 @@ export class Path implements IPath {
634
637
CGPathAddArc ( this . mPath , new interop . Reference ( t ) , 0 , 0 , rect . width ( ) / 2 , ( startAngle * Math . PI ) / 180 , ( ( startAngle + sweepAngle ) * Math . PI ) / 180 , sweepAngle < 0 ) ;
635
638
}
636
639
}
640
+ //@ts -ignore
637
641
offset ( dx : number , dy : number , output ?: Path ) {
638
642
const t = CGAffineTransformMakeTranslation ( dx , dy ) ;
639
643
// if (this._bPath) {
@@ -717,6 +721,7 @@ export class Path implements IPath {
717
721
quadTo ( cpx : number , cpy : number , x : number , y : number ) : void {
718
722
CGPathAddQuadCurveToPoint ( this . mPath , null , cpx , cpy , x , y ) ;
719
723
}
724
+ //@ts -ignore
720
725
transform ( mat : Matrix , output ?: Path ) {
721
726
const path = CGPathCreateCopyByTransformingPath ( this . mPath , new interop . Reference ( mat . mTransform ) ) ;
722
727
if ( output ) {
@@ -832,6 +837,7 @@ export class Path implements IPath {
832
837
isInverseFillType ( ) : boolean {
833
838
return this . mFillType === FillType . INVERSE_EVEN_ODD || this . mFillType === FillType . INVERSE_WINDING ;
834
839
}
840
+ //@ts -ignore
835
841
set ( path : Path ) : void {
836
842
this . mPath = CGPathCreateMutableCopy ( path . mPath ) ;
837
843
}
@@ -889,6 +895,7 @@ export class Paint implements IPaint {
889
895
this . xfermode = paint . xfermode ;
890
896
}
891
897
}
898
+ //@ts -ignore
892
899
getTextPath ( text : string , start : number , end : number , x : number , y : number , path : Path ) {
893
900
const bPath = UIBezierPath . fromStringWithFont ( text . slice ( start , end ) , this . getUIFont ( ) ) ;
894
901
const bounds = bPath . bounds ;
@@ -1399,6 +1406,7 @@ export class Canvas implements ICanvas {
1399
1406
}
1400
1407
1401
1408
@paint
1409
+ //@ts -ignore
1402
1410
drawPaint ( paint : Paint ) : void {
1403
1411
// this.save();
1404
1412
const ctx = this . ctx ;
@@ -1474,6 +1482,7 @@ export class Canvas implements ICanvas {
1474
1482
}
1475
1483
}
1476
1484
1485
+ //@ts -ignore
1477
1486
drawPoint ( x : number , y : number , paint : Paint ) : void {
1478
1487
this . drawLine ( x , y , x , y , paint ) ;
1479
1488
}
@@ -1504,6 +1513,7 @@ export class Canvas implements ICanvas {
1504
1513
this . _drawPath ( paint , ctx ) ;
1505
1514
}
1506
1515
@paint
1516
+ //@ts -ignore
1507
1517
drawLine ( startX : number , startY : number , stopX : number , stopY : number , paint : Paint ) : void {
1508
1518
const oldStyle = paint . style ;
1509
1519
paint . style = Style . STROKE ;
@@ -1556,6 +1566,7 @@ export class Canvas implements ICanvas {
1556
1566
CGContextConcatCTM ( this . ctx , mat . mTransform ) ;
1557
1567
}
1558
1568
@paint
1569
+ //@ts -ignore
1559
1570
drawCircle ( cx : number , cy : number , radius : number , paint : Paint ) : void {
1560
1571
const ctx = this . ctx ;
1561
1572
const hR = radius / 2 ;
@@ -1571,6 +1582,7 @@ export class Canvas implements ICanvas {
1571
1582
console . error ( 'Method not implemented:' , 'drawOval' ) ;
1572
1583
}
1573
1584
@paint
1585
+ //@ts -ignore
1574
1586
drawPath ( path : Path , paint : Paint ) : void {
1575
1587
const ctx = this . ctx ;
1576
1588
this . _drawPath ( paint , ctx , path ) ;
@@ -2020,6 +2032,7 @@ export class Canvas implements ICanvas {
2020
2032
}
2021
2033
2022
2034
@paint
2035
+ //@ts -ignore
2023
2036
drawTextOnPath ( text : string | NSAttributedString , path : Path , hOffset : number , vOffset : number , paint : Paint ) : void {
2024
2037
const ctx = this . ctx ;
2025
2038
const bPath = path . getOrCreateBPath ( ) ;
@@ -2110,14 +2123,15 @@ export class UICustomCanvasView extends UIView {
2110
2123
// this._canvas.scale(1 / owner.density, 1 / owner.density);
2111
2124
// this._canvas.setDensity(owner.density);
2112
2125
if ( owner . shapesCanvas ) {
2113
- const canvas = owner . shapesCanvas as Canvas ;
2126
+ const canvas = owner . shapesCanvas as any as Canvas ;
2114
2127
// canvas.setDensity(owner.density);
2115
2128
const viewport = CGRectMake ( 0 , 0 , size . width , size . height ) ;
2116
2129
const image = canvas . getCGImage ( ) ;
2117
2130
CGContextDrawImage ( context , viewport , image ) ;
2118
2131
} else if ( ! owner . cached && owner . shapes ) {
2119
2132
const shapes = owner . shapes ;
2120
2133
if ( shapes . length > 0 ) {
2134
+ //@ts -ignore
2121
2135
shapes . forEach ( ( s ) => s . drawMyShapeOnCanvas ( this . mCanvas , owner , size . width , size . height ) ) ;
2122
2136
}
2123
2137
}
@@ -2140,6 +2154,7 @@ export class UICustomCanvasView extends UIView {
2140
2154
2141
2155
@CSSType ( 'CanvasView' )
2142
2156
export class CanvasView extends CanvasBase {
2157
+ //@ts -ignore
2143
2158
onDraw ( canvas : Canvas ) {
2144
2159
this . notify ( { eventName : 'draw' , object : this , canvas } ) ;
2145
2160
}
@@ -2168,7 +2183,15 @@ export class CanvasView extends CanvasBase {
2168
2183
2169
2184
export class LinearGradient {
2170
2185
mGradient ;
2171
- constructor ( public x0 : number , public y0 : number , public x1 : number , public y1 : number , public colors : any , public stops : any , public tileMode : TileMode ) { }
2186
+ constructor (
2187
+ public x0 : number ,
2188
+ public y0 : number ,
2189
+ public x1 : number ,
2190
+ public y1 : number ,
2191
+ public colors : any ,
2192
+ public stops : any ,
2193
+ public tileMode : TileMode
2194
+ ) { }
2172
2195
get gradient ( ) {
2173
2196
if ( ! this . mGradient ) {
2174
2197
if ( Array . isArray ( this . colors ) ) {
@@ -2246,7 +2269,14 @@ class Shader {
2246
2269
}
2247
2270
export class RadialGradient extends Shader {
2248
2271
mGradient ;
2249
- constructor ( public centerX : number , public centerY : number , public radius : number , public colors : any , public stops : any , public tileMode : TileMode ) {
2272
+ constructor (
2273
+ public centerX : number ,
2274
+ public centerY : number ,
2275
+ public radius : number ,
2276
+ public colors : any ,
2277
+ public stops : any ,
2278
+ public tileMode : TileMode
2279
+ ) {
2250
2280
super ( ) ;
2251
2281
}
2252
2282
get gradient ( ) {
@@ -2271,7 +2301,11 @@ export class RadialGradient extends Shader {
2271
2301
}
2272
2302
}
2273
2303
export class BitmapShader extends Shader {
2274
- constructor ( public bitmap : any , public tileX : any , public tileY : any ) {
2304
+ constructor (
2305
+ public bitmap : any ,
2306
+ public tileX : any ,
2307
+ public tileY : any
2308
+ ) {
2275
2309
super ( ) ;
2276
2310
}
2277
2311
get image ( ) {
0 commit comments