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