@leafer/canvas-web 1.0.0-beta.4 → 1.0.0-beta.5
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 +7 -7
- package/src/LeaferCanvas.ts +6 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/canvas-web",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "@leafer/canvas-web",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"leaferjs"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@leafer/canvas": "1.0.0-beta.
|
|
23
|
-
"@leafer/math": "1.0.0-beta.
|
|
24
|
-
"@leafer/data": "1.0.0-beta.
|
|
25
|
-
"@leafer/event": "1.0.0-beta.
|
|
26
|
-
"@leafer/debug": "1.0.0-beta.
|
|
22
|
+
"@leafer/canvas": "1.0.0-beta.5",
|
|
23
|
+
"@leafer/math": "1.0.0-beta.5",
|
|
24
|
+
"@leafer/data": "1.0.0-beta.5",
|
|
25
|
+
"@leafer/event": "1.0.0-beta.5",
|
|
26
|
+
"@leafer/debug": "1.0.0-beta.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-beta.
|
|
29
|
+
"@leafer/interface": "1.0.0-beta.5"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/LeaferCanvas.ts
CHANGED
|
@@ -33,15 +33,11 @@ export class LeaferCanvas extends LeaferCanvasBase {
|
|
|
33
33
|
if (!this.autoLayout) this.resize(this.config as IScreenSizeData)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
public
|
|
37
|
-
|
|
38
|
-
view.style.backgroundColor = color
|
|
39
|
-
}
|
|
36
|
+
public set backgroundColor(color: string) { (this.view as HTMLElement).style.backgroundColor = color }
|
|
37
|
+
public get backgroundColor(): string { return (this.view as HTMLElement).style.backgroundColor }
|
|
40
38
|
|
|
41
|
-
public
|
|
42
|
-
|
|
43
|
-
view.style.pointerEvents = hittable ? 'auto' : 'none'
|
|
44
|
-
}
|
|
39
|
+
public set hittable(hittable: boolean) { (this.view as HTMLElement).style.pointerEvents = hittable ? 'auto' : 'none' }
|
|
40
|
+
public get hittable() { return (this.view as HTMLElement).style.pointerEvents !== 'none' }
|
|
45
41
|
|
|
46
42
|
protected __createContext(): void {
|
|
47
43
|
this.context = this.view.getContext('2d') as ICanvasContext2D
|
|
@@ -97,8 +93,8 @@ export class LeaferCanvas extends LeaferCanvasBase {
|
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
public
|
|
101
|
-
const { width, height, pixelRatio } =
|
|
96
|
+
public updateViewSize(): void {
|
|
97
|
+
const { width, height, pixelRatio } = this
|
|
102
98
|
|
|
103
99
|
if (!this.offscreen) {
|
|
104
100
|
const { style } = this.view as HTMLCanvasElement
|