@leafer/display-module 1.0.0-rc.2 → 1.0.0-rc.4

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/display-module",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "@leafer/display-module",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/event": "1.0.0-rc.2",
26
- "@leafer/math": "1.0.0-rc.2"
25
+ "@leafer/event": "1.0.0-rc.4",
26
+ "@leafer/math": "1.0.0-rc.4"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.0.0-rc.2"
29
+ "@leafer/interface": "1.0.0-rc.4"
30
30
  }
31
31
  }
@@ -26,7 +26,12 @@ export const BranchRender: IBranchRenderModule = {
26
26
  canvas.opacity = this.__worldOpacity
27
27
 
28
28
  const blendMode = this.__.isEraser ? 'destination-out' : this.__.blendMode
29
- options.matrix ? canvas.copyWorld(tempCanvas, null, null, blendMode) : canvas.copyWorld(tempCanvas, this.__world, this.__world, blendMode)
29
+
30
+ if (this.__hasMirror || options.matrix) {
31
+ canvas.copyWorld(tempCanvas, null, null, blendMode)
32
+ } else {
33
+ canvas.copyWorld(tempCanvas, this.__world, this.__world, blendMode)
34
+ }
30
35
 
31
36
  tempCanvas.recycle()
32
37
  } else {
@@ -1,4 +1,5 @@
1
1
  import { IEventListener, IEventListenerOptions, IEventListenerMap, IEventListenerItem, IEventListenerId, IEvent, IObject, IEventTarget, ILeafEventerModule } from '@leafer/interface'
2
+ import { EventCreator } from '@leafer/platform'
2
3
 
3
4
  const empty = {}
4
5
 
@@ -70,6 +71,8 @@ export const LeafEventer: ILeafEventerModule = {
70
71
  },
71
72
 
72
73
  emit(type: string, event?: IEvent | IObject, capture?: boolean): void {
74
+ if (!event && EventCreator.has(type)) event = EventCreator.get(type, { type, target: this, current: this } as IEvent)
75
+
73
76
  const map = __getListenerMap(this, capture)
74
77
  const list = map[type]
75
78
  if (list) {
package/src/LeafRender.ts CHANGED
@@ -14,7 +14,7 @@ export const LeafRender: ILeafRenderModule = {
14
14
  this.__draw(tempCanvas, options)
15
15
 
16
16
  const blendMode = this.__.isEraser ? 'destination-out' : this.__.blendMode
17
- if (options.matrix || this.__hasMirror) {
17
+ if (this.__hasMirror || options.matrix) {
18
18
  canvas.copyWorldByReset(tempCanvas, null, null, blendMode)
19
19
  } else {
20
20
  canvas.copyWorldToInner(tempCanvas, this.__world, this.__layout.renderBounds, blendMode)