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