@leafer/data 1.0.5 → 1.0.6
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 +2 -2
- package/src/LeafData.ts +6 -4
- package/types/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/data",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "@leafer/data",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@leafer/interface": "1.0.
|
|
25
|
+
"@leafer/interface": "1.0.6"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/LeafData.ts
CHANGED
|
@@ -12,12 +12,14 @@ export class LeafData implements ILeafData {
|
|
|
12
12
|
public __naturalWidth?: number
|
|
13
13
|
public __naturalHeight?: number
|
|
14
14
|
|
|
15
|
-
public __pathInputed?: number
|
|
16
15
|
public __pathForRender?: IPathCommandData
|
|
17
16
|
|
|
18
17
|
public get __useNaturalRatio() { return true }
|
|
19
18
|
|
|
20
|
-
public get __isLinePath(): boolean {
|
|
19
|
+
public get __isLinePath(): boolean {
|
|
20
|
+
const { path } = this as ILeafData
|
|
21
|
+
return path && path.length === 6 && path[0] === 1 // M = 1
|
|
22
|
+
}
|
|
21
23
|
|
|
22
24
|
public get __blendMode(): string {
|
|
23
25
|
if ((this as ILeafData).eraser && (this as ILeafData).eraser !== 'path') return 'destination-out'
|
|
@@ -60,7 +62,7 @@ export class LeafData implements ILeafData {
|
|
|
60
62
|
if (value !== undefined) return value
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
if (name === 'path' && !this.__pathInputed) return // no path mode
|
|
65
|
+
if (name === 'path' && !(this as ILeafData).__pathInputed) return // no path mode
|
|
64
66
|
|
|
65
67
|
return (this as IObject)['_' + name]
|
|
66
68
|
}
|
|
@@ -89,7 +91,7 @@ export class LeafData implements ILeafData {
|
|
|
89
91
|
value = (this as IObject)['_' + key]
|
|
90
92
|
if (value !== undefined) {
|
|
91
93
|
|
|
92
|
-
if (key === 'path' && !this.__pathInputed) continue // no path mode
|
|
94
|
+
if (key === 'path' && !(this as ILeafData).__pathInputed) continue // no path mode
|
|
93
95
|
|
|
94
96
|
inputValue = __input ? __input[key] : undefined
|
|
95
97
|
data[key] = (inputValue === undefined) ? value : inputValue
|
package/types/index.d.ts
CHANGED