@@ -373,11 +373,11 @@ export class Matrix implements IMatrix {
373
373
}
374
374
public mapPoints ( ...args ) {
375
375
let src : number [ ] ;
376
- let dstIndex : number ,
376
+ let dstIndex : number = 0 ,
377
377
srcIndex : number = 0 ,
378
378
pointCount : number ;
379
379
const pts : number [ ] = args [ 0 ] ;
380
- if ( args . length == = 2 ) {
380
+ if ( args . length < = 2 ) {
381
381
src = args [ 1 ] ;
382
382
} else {
383
383
dstIndex = args [ 1 ] || 0 ;
@@ -386,7 +386,7 @@ export class Matrix implements IMatrix {
386
386
src = args [ 2 ] ;
387
387
}
388
388
src = src || pts ;
389
- pointCount = Math . floor ( pointCount || src . length ) ;
389
+ pointCount = Math . floor ( pointCount || src . length / 2 ) ;
390
390
for ( let index = 0 ; index < pointCount ; index += 2 ) {
391
391
const cgPoint = CGPointApplyAffineTransform ( CGPointMake ( src [ index + srcIndex ] , src [ index + srcIndex + 1 ] ) , this . _transform ) ;
392
392
pts [ index + dstIndex ] = cgPoint . x ;
@@ -2121,7 +2121,7 @@ export class LinearGradient {
2121
2121
if ( ! this . _gradient ) {
2122
2122
if ( Array . isArray ( this . colors ) ) {
2123
2123
const cgColors = this . colors . map ( ( c ) => ( c instanceof Color ? c : new Color ( c ) ) . ios . CGColor ) ;
2124
- this . _gradient = CGGradientCreateWithColors ( CGColorSpaceCreateDeviceRGB ( ) , cgColors as any , null ) ;
2124
+ this . _gradient = CGGradientCreateWithColors ( CGColorSpaceCreateDeviceRGB ( ) , cgColors as any , this . stops ) ;
2125
2125
CFRetain ( this . _gradient ) ;
2126
2126
} else {
2127
2127
const cgColors = [ this . colors , this . stops ] . map ( ( c ) => ( c instanceof Color ? c : new Color ( c ) ) . ios . CGColor ) ;
0 commit comments