@leafer/canvas 1.0.0-alpha.21 → 1.0.0-alpha.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/canvas",
3
- "version": "1.0.0-alpha.21",
3
+ "version": "1.0.0-alpha.23",
4
4
  "description": "@leafer/canvas",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,9 +19,9 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/list": "1.0.0-alpha.21"
22
+ "@leafer/list": "1.0.0-alpha.23"
23
23
  },
24
24
  "devDependencies": {
25
- "@leafer/interface": "1.0.0-alpha.21"
25
+ "@leafer/interface": "1.0.0-alpha.23"
26
26
  }
27
27
  }
@@ -1,16 +1,10 @@
1
- import { ILeaferCanvas, IScreenSizeData, ILeafer, ICanvasManager } from '@leafer/interface'
2
-
1
+ import { ILeaferCanvas, IScreenSizeData, ICanvasManager } from '@leafer/interface'
2
+ import { Creator } from '@leafer/platform'
3
3
 
4
4
  export class CanvasManager implements ICanvasManager {
5
5
 
6
- public leafer: ILeafer
7
-
8
6
  public list: ILeaferCanvas[] = []
9
7
 
10
- constructor(leafer: ILeafer) {
11
- this.leafer = leafer
12
- }
13
-
14
8
  public add(canvas: ILeaferCanvas): void {
15
9
  canvas.manager = this
16
10
  this.list.push(canvas)
@@ -27,7 +21,7 @@ export class CanvasManager implements ICanvasManager {
27
21
  }
28
22
  }
29
23
 
30
- const canvas = this.leafer.creator.canvas(size)
24
+ const canvas = Creator.canvas(size)
31
25
  this.add(canvas)
32
26
  return canvas
33
27
  }
@@ -56,7 +50,6 @@ export class CanvasManager implements ICanvasManager {
56
50
 
57
51
  public destory(): void {
58
52
  this.clear()
59
- this.leafer = null
60
53
  }
61
54
 
62
55
  }
@@ -1,5 +1,6 @@
1
1
  import { IScreenSizeData, IHitCanvasManager, ILeaf, IHitCanvas, ILeaferCanvas, ILeafList } from '@leafer/interface'
2
2
  import { LeafList } from '@leafer/list'
3
+ import { Creator } from '@leafer/platform'
3
4
 
4
5
  import { CanvasManager } from './CanvasManager'
5
6
 
@@ -13,12 +14,12 @@ export class HitCanvasManager extends CanvasManager implements IHitCanvasManager
13
14
 
14
15
  public getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas {
15
16
  this.imageTypeList.push(leaf)
16
- return this.leafer.creator.hitCanvas(size)
17
+ return Creator.hitCanvas(size)
17
18
  }
18
19
 
19
20
  public getPathType(leaf: ILeaf): IHitCanvas {
20
21
  this.pathTypeList.push(leaf)
21
- return this.leafer.creator.hitCanvas()
22
+ return Creator.hitCanvas()
22
23
  }
23
24
 
24
25
  public clearImageType(): void {