Skip to content

Commit 0f78357

Browse files
author
farfromrefuge
committed
chore: tsc fix
1 parent db56388 commit 0f78357

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

src/ui-canvas/index.ios.ts

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,10 @@ export class Matrix implements IMatrix {
528528

529529
export class PathEffect {}
530530
export class DashPathEffect extends PathEffect {
531-
constructor(public intervals: number[], public phase: number) {
531+
constructor(
532+
public intervals: number[],
533+
public phase: number
534+
) {
532535
super();
533536
}
534537
}
@@ -634,6 +637,7 @@ export class Path implements IPath {
634637
CGPathAddArc(this.mPath, new interop.Reference(t), 0, 0, rect.width() / 2, (startAngle * Math.PI) / 180, ((startAngle + sweepAngle) * Math.PI) / 180, sweepAngle < 0);
635638
}
636639
}
640+
//@ts-ignore
637641
offset(dx: number, dy: number, output?: Path) {
638642
const t = CGAffineTransformMakeTranslation(dx, dy);
639643
// if (this._bPath) {
@@ -717,6 +721,7 @@ export class Path implements IPath {
717721
quadTo(cpx: number, cpy: number, x: number, y: number): void {
718722
CGPathAddQuadCurveToPoint(this.mPath, null, cpx, cpy, x, y);
719723
}
724+
//@ts-ignore
720725
transform(mat: Matrix, output?: Path) {
721726
const path = CGPathCreateCopyByTransformingPath(this.mPath, new interop.Reference(mat.mTransform));
722727
if (output) {
@@ -832,6 +837,7 @@ export class Path implements IPath {
832837
isInverseFillType(): boolean {
833838
return this.mFillType === FillType.INVERSE_EVEN_ODD || this.mFillType === FillType.INVERSE_WINDING;
834839
}
840+
//@ts-ignore
835841
set(path: Path): void {
836842
this.mPath = CGPathCreateMutableCopy(path.mPath);
837843
}
@@ -889,6 +895,7 @@ export class Paint implements IPaint {
889895
this.xfermode = paint.xfermode;
890896
}
891897
}
898+
//@ts-ignore
892899
getTextPath(text: string, start: number, end: number, x: number, y: number, path: Path) {
893900
const bPath = UIBezierPath.fromStringWithFont(text.slice(start, end), this.getUIFont());
894901
const bounds = bPath.bounds;
@@ -1399,6 +1406,7 @@ export class Canvas implements ICanvas {
13991406
}
14001407

14011408
@paint
1409+
//@ts-ignore
14021410
drawPaint(paint: Paint): void {
14031411
// this.save();
14041412
const ctx = this.ctx;
@@ -1474,6 +1482,7 @@ export class Canvas implements ICanvas {
14741482
}
14751483
}
14761484

1485+
//@ts-ignore
14771486
drawPoint(x: number, y: number, paint: Paint): void {
14781487
this.drawLine(x, y, x, y, paint);
14791488
}
@@ -1504,6 +1513,7 @@ export class Canvas implements ICanvas {
15041513
this._drawPath(paint, ctx);
15051514
}
15061515
@paint
1516+
//@ts-ignore
15071517
drawLine(startX: number, startY: number, stopX: number, stopY: number, paint: Paint): void {
15081518
const oldStyle = paint.style;
15091519
paint.style = Style.STROKE;
@@ -1556,6 +1566,7 @@ export class Canvas implements ICanvas {
15561566
CGContextConcatCTM(this.ctx, mat.mTransform);
15571567
}
15581568
@paint
1569+
//@ts-ignore
15591570
drawCircle(cx: number, cy: number, radius: number, paint: Paint): void {
15601571
const ctx = this.ctx;
15611572
const hR = radius / 2;
@@ -1571,6 +1582,7 @@ export class Canvas implements ICanvas {
15711582
console.error('Method not implemented:', 'drawOval');
15721583
}
15731584
@paint
1585+
//@ts-ignore
15741586
drawPath(path: Path, paint: Paint): void {
15751587
const ctx = this.ctx;
15761588
this._drawPath(paint, ctx, path);
@@ -2020,6 +2032,7 @@ export class Canvas implements ICanvas {
20202032
}
20212033

20222034
@paint
2035+
//@ts-ignore
20232036
drawTextOnPath(text: string | NSAttributedString, path: Path, hOffset: number, vOffset: number, paint: Paint): void {
20242037
const ctx = this.ctx;
20252038
const bPath = path.getOrCreateBPath();
@@ -2110,14 +2123,15 @@ export class UICustomCanvasView extends UIView {
21102123
// this._canvas.scale(1 / owner.density, 1 / owner.density);
21112124
// this._canvas.setDensity(owner.density);
21122125
if (owner.shapesCanvas) {
2113-
const canvas = owner.shapesCanvas as Canvas;
2126+
const canvas = owner.shapesCanvas as any as Canvas;
21142127
// canvas.setDensity(owner.density);
21152128
const viewport = CGRectMake(0, 0, size.width, size.height);
21162129
const image = canvas.getCGImage();
21172130
CGContextDrawImage(context, viewport, image);
21182131
} else if (!owner.cached && owner.shapes) {
21192132
const shapes = owner.shapes;
21202133
if (shapes.length > 0) {
2134+
//@ts-ignore
21212135
shapes.forEach((s) => s.drawMyShapeOnCanvas(this.mCanvas, owner, size.width, size.height));
21222136
}
21232137
}
@@ -2140,6 +2154,7 @@ export class UICustomCanvasView extends UIView {
21402154

21412155
@CSSType('CanvasView')
21422156
export class CanvasView extends CanvasBase {
2157+
//@ts-ignore
21432158
onDraw(canvas: Canvas) {
21442159
this.notify({ eventName: 'draw', object: this, canvas });
21452160
}
@@ -2168,7 +2183,15 @@ export class CanvasView extends CanvasBase {
21682183

21692184
export class LinearGradient {
21702185
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+
) {}
21722195
get gradient() {
21732196
if (!this.mGradient) {
21742197
if (Array.isArray(this.colors)) {
@@ -2246,7 +2269,14 @@ class Shader {
22462269
}
22472270
export class RadialGradient extends Shader {
22482271
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+
) {
22502280
super();
22512281
}
22522282
get gradient() {
@@ -2271,7 +2301,11 @@ export class RadialGradient extends Shader {
22712301
}
22722302
}
22732303
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+
) {
22752309
super();
22762310
}
22772311
get image() {

0 commit comments

Comments
 (0)