Skip to content

Commit

Permalink
Merge pull request #65 from nativescript-community/types/get-color-fi…
Browse files Browse the repository at this point in the history
…lter

chore(ui-canvas): Added missing types for getColorFilter/setColorFilter
  • Loading branch information
farfromrefug authored Nov 27, 2024
2 parents 0522ecc + 19f118b commit c970f23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/ui-canvas/canvas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export class Paint extends ProxyClass {
// public getFontSpacing(): number;
public setXfermode(param0: PorterDuffXfermode): PorterDuffXfermode;
public getXfermode(): PorterDuffXfermode;
public setColorFilter(param0: ColorFilter): void;
public getColorFilter(): ColorFilter;
public setColorFilter(param0: ColorFilter): ColorFilter;
}

// export class StaticLayout {
Expand Down
10 changes: 6 additions & 4 deletions src/ui-canvas/canvas.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,6 @@ export class Paint implements IPaint {
public getStrokeJoin(): Join {
return this.strokeJoin;
}
public getColorFilter() {
return this.colorFilter;
}
public setStrokeWidth(value: number): void {
this.strokeWidth = value;
}
Expand Down Expand Up @@ -1089,11 +1086,16 @@ export class Paint implements IPaint {
public getShader() {
return this.shader as any as IShader;
}
public setColorFilter(value: any) {
public getColorFilter() {
return this.colorFilter;
}
public setColorFilter(value: any): any {
if (this.colorFilter) {
this.colorFilter.release();
}
this.colorFilter = value;

return value;
}
setFont(font: Font) {
if (font === this.mFont) {
Expand Down

0 comments on commit c970f23

Please sign in to comment.