@leafer/canvas-node 1.0.0-beta.9 → 1.0.0-rc.10
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 -5
- package/src/LeaferCanvas.ts +9 -7
- package/types/index.d.ts +10 -0
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/canvas-node",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.10",
|
|
4
4
|
"description": "@leafer/canvas-node",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
|
+
"types": "types/index.d.ts",
|
|
8
9
|
"files": [
|
|
9
|
-
"src"
|
|
10
|
+
"src",
|
|
11
|
+
"types",
|
|
12
|
+
"dist"
|
|
10
13
|
],
|
|
11
14
|
"repository": {
|
|
12
15
|
"type": "git",
|
|
@@ -19,10 +22,9 @@
|
|
|
19
22
|
"leaferjs"
|
|
20
23
|
],
|
|
21
24
|
"dependencies": {
|
|
22
|
-
"@leafer/
|
|
23
|
-
"@leafer/canvas": "1.0.0-beta.9"
|
|
25
|
+
"@leafer/core": "1.0.0-rc.10"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@leafer/interface": "1.0.0-
|
|
28
|
+
"@leafer/interface": "1.0.0-rc.10"
|
|
27
29
|
}
|
|
28
30
|
}
|
package/src/LeaferCanvas.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { IObject, IScreenSizeData } from '@leafer/interface'
|
|
2
|
-
import { LeaferCanvasBase } from '@leafer/
|
|
3
|
-
import { Platform } from '@leafer/platform'
|
|
2
|
+
import { LeaferCanvasBase, Platform, canvasPatch } from '@leafer/core'
|
|
4
3
|
|
|
5
4
|
export class LeaferCanvas extends LeaferCanvasBase {
|
|
6
5
|
|
|
7
|
-
public
|
|
8
|
-
|
|
9
|
-
public get allowBackgroundColor(): boolean { return false }
|
|
6
|
+
public get allowBackgroundColor(): boolean { return true }
|
|
10
7
|
|
|
11
8
|
public init(): void {
|
|
12
9
|
|
|
@@ -14,6 +11,11 @@ export class LeaferCanvas extends LeaferCanvasBase {
|
|
|
14
11
|
this.__createContext()
|
|
15
12
|
|
|
16
13
|
this.resize(this.config as IScreenSizeData)
|
|
14
|
+
|
|
15
|
+
if (Platform.roundRectPatch) {
|
|
16
|
+
(this.context as IObject).__proto__.roundRect = null
|
|
17
|
+
canvasPatch((this.context as IObject).__proto__)
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
protected __createView(): void {
|
|
@@ -23,8 +25,8 @@ export class LeaferCanvas extends LeaferCanvasBase {
|
|
|
23
25
|
public updateViewSize(): void {
|
|
24
26
|
const { width, height, pixelRatio } = this
|
|
25
27
|
|
|
26
|
-
this.view.width = width * pixelRatio
|
|
27
|
-
this.view.height = height * pixelRatio
|
|
28
|
+
this.view.width = Math.ceil(width * pixelRatio)
|
|
29
|
+
this.view.height = Math.ceil(height * pixelRatio)
|
|
28
30
|
|
|
29
31
|
this.clientBounds = this.bounds
|
|
30
32
|
}
|
package/types/index.d.ts
ADDED