@leafer/display-module 1.0.0-beta.10 → 1.0.0-beta.12

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-beta.10",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "@leafer/display-module",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,10 +19,10 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/event": "1.0.0-beta.10",
23
- "@leafer/math": "1.0.0-beta.10"
22
+ "@leafer/event": "1.0.0-beta.12",
23
+ "@leafer/math": "1.0.0-beta.12"
24
24
  },
25
25
  "devDependencies": {
26
- "@leafer/interface": "1.0.0-beta.10"
26
+ "@leafer/interface": "1.0.0-beta.12"
27
27
  }
28
28
  }
package/src/LeafHit.ts CHANGED
@@ -8,7 +8,7 @@ const inner = {} as IRadiusPointData
8
8
  export const LeafHit: ILeafHitModule = {
9
9
 
10
10
  __hitWorld(point: IRadiusPointData): boolean {
11
- if (this.__layout.hitCanvasChanged) {
11
+ if (this.__layout.hitCanvasChanged || !this.__hitCanvas) {
12
12
  this.__updateHitCanvas()
13
13
  this.__layout.hitCanvasChanged = false
14
14
  }
package/src/LeafMatrix.ts CHANGED
@@ -2,14 +2,14 @@ import { ILeafMatrixModule } from '@leafer/interface'
2
2
  import { OneRadian, MatrixHelper } from '@leafer/math'
3
3
 
4
4
 
5
- const { defaultMatrix } = MatrixHelper
6
5
  const { sin, cos } = Math
6
+ const defaultWorld = { ...MatrixHelper.defaultMatrix, scaleX: 1, scaleY: 1 }
7
7
 
8
8
  export const LeafMatrix: ILeafMatrixModule = {
9
9
 
10
10
  __updateWorldMatrix(): void {
11
11
 
12
- const pw = this.parent ? this.parent.__world : defaultMatrix
12
+ const pw = this.parent ? this.parent.__world : defaultWorld
13
13
  const r = this.__local
14
14
  const w = this.__world
15
15
 
@@ -22,6 +22,9 @@ export const LeafMatrix: ILeafMatrixModule = {
22
22
  w.d = r.c * pw.b + r.d * pw.d
23
23
  w.e = r.e * pw.a + r.f * pw.c + pw.e
24
24
  w.f = r.e * pw.b + r.f * pw.d + pw.f
25
+
26
+ w.scaleX = pw.scaleX * this.__.scaleX
27
+ w.scaleY = pw.scaleY * this.__.scaleY
25
28
  } else {
26
29
  w.a = pw.a
27
30
  w.b = pw.b
@@ -29,6 +32,9 @@ export const LeafMatrix: ILeafMatrixModule = {
29
32
  w.d = pw.d
30
33
  w.e = r.e * pw.a + r.f * pw.c + pw.e
31
34
  w.f = r.e * pw.b + r.f * pw.d + pw.f
35
+
36
+ w.scaleX = pw.scaleX
37
+ w.scaleY = pw.scaleY
32
38
  }
33
39
  },
34
40