@leafer/canvas 1.9.5 → 1.9.7

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.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "@leafer/canvas",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,15 +22,15 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/file": "1.9.5",
26
- "@leafer/list": "1.9.5",
27
- "@leafer/math": "1.9.5",
28
- "@leafer/data": "1.9.5",
29
- "@leafer/path": "1.9.5",
30
- "@leafer/debug": "1.9.5",
31
- "@leafer/platform": "1.9.5"
25
+ "@leafer/file": "1.9.7",
26
+ "@leafer/list": "1.9.7",
27
+ "@leafer/math": "1.9.7",
28
+ "@leafer/data": "1.9.7",
29
+ "@leafer/path": "1.9.7",
30
+ "@leafer/debug": "1.9.7",
31
+ "@leafer/platform": "1.9.7"
32
32
  },
33
33
  "devDependencies": {
34
- "@leafer/interface": "1.9.5"
34
+ "@leafer/interface": "1.9.7"
35
35
  }
36
36
  }
@@ -6,7 +6,7 @@ import { DataHelper, isUndefined } from '@leafer/data'
6
6
  import { Canvas } from './Canvas'
7
7
 
8
8
 
9
- const { copy, multiplyParent } = MatrixHelper, { round } = Math, tempPixelBounds = new Bounds(), tempPixelBounds2 = new Bounds()
9
+ const { copy, multiplyParent, pixelScale } = MatrixHelper, { round } = Math, tempPixelBounds = new Bounds(), tempPixelBounds2 = new Bounds()
10
10
  const minSize: IScreenSizeData = { width: 1, height: 1, pixelRatio: 1 }
11
11
 
12
12
  export const canvasSizeAttrs = ['width', 'height', 'pixelRatio']
@@ -136,13 +136,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
136
136
  const { pixelRatio, pixelSnap } = this, w = this.worldTransform
137
137
 
138
138
  if (parentMatrix) multiplyParent(matrix, parentMatrix, w)
139
-
140
- w.a = matrix.a * pixelRatio
141
- w.b = matrix.b * pixelRatio
142
- w.c = matrix.c * pixelRatio
143
- w.d = matrix.d * pixelRatio
144
- w.e = matrix.e * pixelRatio
145
- w.f = matrix.f * pixelRatio
139
+ pixelScale(matrix, pixelRatio, w)
146
140
 
147
141
  if (pixelSnap) {
148
142
  if (matrix.half && (matrix.half * pixelRatio) % 2) w.e = round(w.e - 0.5) + 0.5, w.f = round(w.f - 0.5) + 0.5