@leafer/path 1.0.0-rc.16 → 1.0.0-rc.18
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 +5 -0
- package/src/index.ts +2 -0
- package/types/index.d.ts +4 -1
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.18",
|
|
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.18",
|
|
26
|
+
"@leafer/debug": "1.0.0-rc.18"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-rc.
|
|
29
|
+
"@leafer/interface": "1.0.0-rc.18"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/PathCreator.ts
CHANGED
|
@@ -13,11 +13,16 @@ export class PathCreator implements IPathDrawer {
|
|
|
13
13
|
public __path: IPathCommandData // 提供一个更安全的内部变量(比如覆盖给Pen时需要用到,避免与原有属性冲突)
|
|
14
14
|
|
|
15
15
|
constructor(path?: IPathCommandData | IPathString) {
|
|
16
|
+
this.set(path)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public set(path?: IPathCommandData | IPathString): PathCreator {
|
|
16
20
|
if (path) {
|
|
17
21
|
this.__path = typeof path === 'string' ? PathHelper.parse(path) : path
|
|
18
22
|
} else {
|
|
19
23
|
this.__path = []
|
|
20
24
|
}
|
|
25
|
+
return this
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
public beginPath(): PathCreator {
|
package/src/index.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare class PathCreator implements IPathDrawer {
|
|
|
26
26
|
get path(): IPathCommandData;
|
|
27
27
|
__path: IPathCommandData;
|
|
28
28
|
constructor(path?: IPathCommandData | IPathString);
|
|
29
|
+
set(path?: IPathCommandData | IPathString): PathCreator;
|
|
29
30
|
beginPath(): PathCreator;
|
|
30
31
|
moveTo(x: number, y: number): PathCreator;
|
|
31
32
|
lineTo(x: number, y: number): PathCreator;
|
|
@@ -99,4 +100,6 @@ declare const NeedConvertToCanvasCommandMap: INumberMap;
|
|
|
99
100
|
declare const PathNumberCommandMap: IStringMap;
|
|
100
101
|
declare const PathNumberCommandLengthMap: INumberMap;
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
declare const pen: PathCreator;
|
|
104
|
+
|
|
105
|
+
export { BezierHelper, EllipseHelper, NeedConvertToCanvasCommandMap, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, RectHelper, pen };
|