@leafer/path 1.0.0-rc.19 → 1.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/PathCreator.ts +4 -2
- package/types/index.d.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/path",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.20",
|
|
4
4
|
"description": "@leafer/path",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/math": "1.0.0-rc.
|
|
26
|
-
"@leafer/debug": "1.0.0-rc.
|
|
25
|
+
"@leafer/math": "1.0.0-rc.20",
|
|
26
|
+
"@leafer/debug": "1.0.0-rc.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-rc.
|
|
29
|
+
"@leafer/interface": "1.0.0-rc.20"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/PathCreator.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IPathCommandData,
|
|
1
|
+
import { IPathCommandData, IPathCreator, IPathString } from '@leafer/interface'
|
|
2
2
|
import { PathCommandDataHelper } from './PathCommandDataHelper'
|
|
3
3
|
import { PathHelper } from './PathHelper'
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
const { moveTo, lineTo, quadraticCurveTo, bezierCurveTo, closePath, beginPath, rect, roundRect, ellipse, arc, arcTo, drawEllipse, drawArc, drawPoints } = PathCommandDataHelper
|
|
7
7
|
|
|
8
|
-
export class PathCreator implements
|
|
8
|
+
export class PathCreator implements IPathCreator { // tip: rewrited Pen
|
|
9
9
|
|
|
10
10
|
public set path(value: IPathCommandData) { this.__path = value }
|
|
11
11
|
public get path() { return this.__path }
|
|
@@ -101,4 +101,6 @@ export class PathCreator implements IPathDrawer {
|
|
|
101
101
|
return this
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
public clearPath = this.beginPath
|
|
105
|
+
|
|
104
106
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPathCreator, IPathCommandData,
|
|
1
|
+
import { IPathCreator, IPathCommandData, IPathString, IPathDrawer, IBoundsData, ITwoPointBoundsData, IPointData, INumberMap, IStringMap } from '@leafer/interface';
|
|
2
2
|
|
|
3
3
|
declare const PathHelper: {
|
|
4
4
|
creator: IPathCreator;
|
|
@@ -21,7 +21,7 @@ declare const PathConvert: {
|
|
|
21
21
|
pushData(data: IPathCommandData, strNum: string | number): void;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
declare class PathCreator implements
|
|
24
|
+
declare class PathCreator implements IPathCreator {
|
|
25
25
|
set path(value: IPathCommandData);
|
|
26
26
|
get path(): IPathCommandData;
|
|
27
27
|
__path: IPathCommandData;
|
|
@@ -41,6 +41,7 @@ declare class PathCreator implements IPathDrawer {
|
|
|
41
41
|
drawEllipse(x: number, y: number, radiusX: number, radiusY: number, rotation?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): PathCreator;
|
|
42
42
|
drawArc(x: number, y: number, radius: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): PathCreator;
|
|
43
43
|
drawPoints(points: number[], curve?: boolean | number, close?: boolean): PathCreator;
|
|
44
|
+
clearPath: () => PathCreator;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
declare const PathCommandDataHelper: {
|