@leafer/canvas 1.9.6 → 1.9.8

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.6",
3
+ "version": "1.9.8",
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.6",
26
- "@leafer/list": "1.9.6",
27
- "@leafer/math": "1.9.6",
28
- "@leafer/data": "1.9.6",
29
- "@leafer/path": "1.9.6",
30
- "@leafer/debug": "1.9.6",
31
- "@leafer/platform": "1.9.6"
25
+ "@leafer/file": "1.9.8",
26
+ "@leafer/list": "1.9.8",
27
+ "@leafer/math": "1.9.8",
28
+ "@leafer/data": "1.9.8",
29
+ "@leafer/path": "1.9.8",
30
+ "@leafer/debug": "1.9.8",
31
+ "@leafer/platform": "1.9.8"
32
32
  },
33
33
  "devDependencies": {
34
- "@leafer/interface": "1.9.6"
34
+ "@leafer/interface": "1.9.8"
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,15 +136,9 @@ 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
+ pixelScale(matrix, pixelRatio, w)
139
140
 
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
146
-
147
- if (pixelSnap) {
141
+ if (pixelSnap && !matrix.ignorePixelSnap) {
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
149
143
  else w.e = round(w.e), w.f = round(w.f)
150
144
  }