@leafer/data 1.0.0-bate → 1.0.0-beta.10

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/LeafData.ts +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/data",
3
- "version": "1.0.0-bate",
3
+ "version": "1.0.0-beta.10",
4
4
  "description": "@leafer/data",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,6 +19,6 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "devDependencies": {
22
- "@leafer/interface": "1.0.0-bate"
22
+ "@leafer/interface": "1.0.0-beta.10"
23
23
  }
24
24
  }
package/src/LeafData.ts CHANGED
@@ -7,6 +7,11 @@ export class LeafData implements ILeafData {
7
7
  public __input: IObject
8
8
  public __middle: IObject
9
9
 
10
+ public __single: boolean
11
+
12
+ public __naturalWidth?: number
13
+ public __naturalHeight?: number
14
+
10
15
  constructor(leaf: ILeaf) {
11
16
  this.__leaf = leaf
12
17
  }
@@ -61,6 +66,18 @@ export class LeafData implements ILeafData {
61
66
  return this.__middle && this.__middle[name]
62
67
  }
63
68
 
69
+ public __checkSingle(): void {
70
+ if ((this as ILeafData).blendMode === 'pass-through') {
71
+ if (this.__leaf.__hasEraser || (this as ILeafData).isEraser) {
72
+ this.__single = true
73
+ } else if (this.__single) {
74
+ this.__single = false
75
+ }
76
+ } else {
77
+ this.__single = true
78
+ }
79
+ }
80
+
64
81
  public destroy(): void {
65
82
  this.__leaf = null
66
83
  }