@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 +9 -9
- package/src/LeaferCanvasBase.ts +3 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/canvas",
|
|
3
|
-
"version": "1.9.
|
|
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.
|
|
26
|
-
"@leafer/list": "1.9.
|
|
27
|
-
"@leafer/math": "1.9.
|
|
28
|
-
"@leafer/data": "1.9.
|
|
29
|
-
"@leafer/path": "1.9.
|
|
30
|
-
"@leafer/debug": "1.9.
|
|
31
|
-
"@leafer/platform": "1.9.
|
|
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.
|
|
34
|
+
"@leafer/interface": "1.9.8"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/LeaferCanvasBase.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
}
|