Skip to content

Commit

Permalink
Remove unsupported/incorrect methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Nov 8, 2024
1 parent 91141cb commit a28f488
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 67 deletions.
11 changes: 0 additions & 11 deletions docs/docs/shape-custom-shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,24 +439,13 @@ Shape data will be updated during rendering, or call `shape.updateData()` to upd
```
- `cx`, `cy` : Control point
- `x`, `y` : End point
- Add smooth quadratic bezier of lines
```javascript
lines.smoothQuadraticBezierTo(x, y);
```
- `x`, `y` : End point
- Add cubic bezier of lines
```javascript
lines.cubicBezierTo(cx0, cy0, cx1, cy1, x, y);
```
- `cx0`, `cy0` : Control point0
- `cx1`, `cy1` : Control point1
- `x`, `y` : End point
- Add smooth cubic bezier of lines
```javascript
lines.smoothCubicBezierTo(cx1, cy1, x, y);
```
- `cx1`, `cy1` : Control point1
- `x`, `y` : End point
- End commands
- Close path, to fill color
```javascript
Expand Down
7 changes: 0 additions & 7 deletions plugins/gameobjects/shape/shapes/geoms/lines/Lines.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,12 @@ export default class Lines extends PathBase {
cx: number, cy: number,
x: number, y: number
): this;
smoothQuadraticBezierTo(
x: number, y: number
): this;

cubicBezierTo(
cx0: number, cy0: number,
cx1: number, cy1: number,
x: number, y: number
): this;
smoothCubicBezierTo(
cx1: number, cy1: number,
x: number, y: number
): this;

close(): this;

Expand Down
14 changes: 0 additions & 14 deletions plugins/gameobjects/shape/shapes/geoms/lines/Lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,13 @@ class Lines extends PathBase {
return this;
}

smoothQuadraticBezierTo(x, y) {
this.builder.smoothQuadraticBezierTo(x, y);

this.dirty = true;
return this;
}

cubicBezierTo(cx0, cy0, cx1, cy1, x, y) {
this.builder.cubicBezierTo(cx0, cy0, cx1, cy1, x, y);

this.dirty = true;
return this;
}

smoothCubicBezierTo(cx1, cy1, x, y) {
this.builder.smoothCubicBezierTo(cx1, cy1, x, y);

this.dirty = true;
return this;
}

close() {
this.builder.close();

Expand Down
18 changes: 0 additions & 18 deletions plugins/geom/pathdata/PathDataBuilder/AddPathMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,6 @@ export default {

this.lastPointX = x;
this.lastPointY = y;
this.lastCX = cx;
this.lastCY = cy;
return this;
},

smoothQuadraticBezierTo(x, y) {
var cx = this.lastPointX * 2 - this.lastCX;
var cy = this.lastPointY * 2 - this.lastCY;
this.quadraticBezierTo(cx, cy, x, y);
return this;
},

Expand All @@ -108,15 +99,6 @@ export default {

this.lastPointX = x;
this.lastPointY = y;
this.lastCX = cx1;
this.lastCY = cy1;
return this;
},

smoothCubicBezierTo(cx1, cy1, x, y) {
var cx0 = this.lastPointX * 2 - this.lastCX;
var cy0 = this.lastPointY * 2 - this.lastCY;
this.cubicBezierTo(cx0, cy0, cx1, cy1, x, y);
return this;
},

Expand Down
17 changes: 0 additions & 17 deletions plugins/geom/pathdata/PathDataBuilder/TransformPointsMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ export default {
var pathDataCnt = this.pathData.length;
this.lastPointX = this.pathData[pathDataCnt - 2];
this.lastPointY = this.pathData[pathDataCnt - 1];
if (this.lastCX !== undefined) {
var point = {
x: this.lastCX,
y: this.lastCY
}
PointRotateAround(point, centerX, centerY, angle);
this.lastCX = point.x;
this.lastCY = point.y;
}
return this;
},

Expand All @@ -38,14 +29,6 @@ export default {
Scale(centerX, centerY, scaleX, scaleY, this.pathData);
this.lastPointX = this.pathData[pathDataCnt - 2];
this.lastPointY = this.pathData[pathDataCnt - 1];
if (this.lastCX !== undefined) {
var x = this.lastCX - centerX;
var y = this.lastCY - centerY;
x *= scaleX;
y *= scaleY;
this.lastCX = x + centerX;
this.lastCY = y + centerY;
}
return this;
},

Expand Down

0 comments on commit a28f488

Please sign in to comment.