Skip to content

Commit adaa29d

Browse files
committed
Merge branch 'master' of github.com:nativescript-community/ui-canvas
2 parents 385339e + 0af2a3b commit adaa29d

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/canvas.android.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export class Path {
414414
}
415415
}
416416
export class RadialGradient {
417-
_native: android.graphics.LinearGradient;
417+
_native: android.graphics.RadialGradient;
418418
getNative() {
419419
return this._native;
420420
}
@@ -441,19 +441,23 @@ export class LinearGradient {
441441
return this._native;
442442
}
443443
constructor(param0: number, param1: number, param2: number, param3: any, param4: any, param5: any, param6: any) {
444-
if (Array.isArray(param4)) {
445-
const testArray = Array.create('int', param4.length);
446-
param4.forEach((c, i) => (testArray[i] = createColorParam(c)));
447-
param4 = testArray;
448-
} else if (param4.hasOwnProperty('length')) {
449-
param4 = createColorParam(param4);
444+
if (param4 != null) {
445+
if (Array.isArray(param4)) {
446+
const testArray = Array.create('int', param4.length);
447+
param4.forEach((c, i) => (testArray[i] = createColorParam(c)));
448+
param4 = testArray;
449+
} else {
450+
param4 = createColorParam(param4);
451+
}
450452
}
451-
if (Array.isArray(param5)) {
452-
const testArray = Array.create('float', param4.length);
453-
param5.forEach((c, i) => (testArray[i] = c));
454-
param5 = testArray;
455-
} else if (param5.hasOwnProperty('length')) {
456-
param5 = createColorParam(param5);
453+
if (param5 != null) {
454+
if (Array.isArray(param5)) {
455+
const testArray = Array.create('float', param4.length);
456+
param5.forEach((c, i) => (testArray[i] = c));
457+
param5 = testArray;
458+
} else {
459+
param5 = createColorParam(param5);
460+
}
457461
}
458462
this._native = new android.graphics.LinearGradient(param0, param1, param2, param3, param4, param5, param6);
459463
return new Proxy(this, this);

0 commit comments

Comments
 (0)