@leafer-ui/render 1.0.0-rc.3 → 1.0.0-rc.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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/UIRender.ts +10 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/render",
3
- "version": "1.0.0-rc.3",
3
+ "version": "1.0.0-rc.5",
4
4
  "description": "@leafer-ui/render",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer-ui/external": "1.0.0-rc.3"
25
+ "@leafer-ui/external": "1.0.0-rc.5"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.0.0-rc.3",
29
- "@leafer-ui/interface": "1.0.0-rc.3"
28
+ "@leafer/interface": "1.0.0-rc.5",
29
+ "@leafer-ui/interface": "1.0.0-rc.5"
30
30
  }
31
31
  }
package/src/UIRender.ts CHANGED
@@ -30,9 +30,9 @@ export const UIRender: IUIRenderModule = {
30
30
 
31
31
  this.__drawRenderPath(canvas)
32
32
 
33
- if (fill) Paint.fill(this, canvas, fill as string)
33
+ if (fill) Paint.fill(fill as string, this, canvas)
34
34
  if (__drawAfterFill) this.__drawAfterFill(canvas, options)
35
- if (stroke) Paint.stroke(this, canvas, stroke as string)
35
+ if (stroke) Paint.stroke(stroke as string, this, canvas, options)
36
36
  },
37
37
 
38
38
  __draw(canvas: ILeaferCanvas, options: IRenderOptions): void {
@@ -51,22 +51,22 @@ export const UIRender: IUIRenderModule = {
51
51
 
52
52
  if (shadow) Effect.shadow(this, canvas, shape, options)
53
53
 
54
- if (fill) this.__.__isFills ? Paint.fills(this, canvas, fill as ILeafPaint[]) : Paint.fill(this, canvas, fill as string)
54
+ if (fill) this.__.__isFills ? Paint.fills(fill as ILeafPaint[], this, canvas) : Paint.fill(fill as string, this, canvas)
55
55
 
56
56
  if (__drawAfterFill) this.__drawAfterFill(canvas, options)
57
57
 
58
58
  if (innerShadow) Effect.innerShadow(this, canvas, shape, options)
59
59
 
60
- if (stroke) this.__.__isStrokes ? Paint.strokes(this, canvas, stroke as ILeafStrokePaint[]) : Paint.stroke(this, canvas, stroke as string)
60
+ if (stroke) this.__.__isStrokes ? Paint.strokes(stroke as ILeafStrokePaint[], this, canvas, options) : Paint.stroke(stroke as string, this, canvas, options)
61
61
 
62
62
  if (shape.worldCanvas) shape.worldCanvas.recycle()
63
63
  shape.canvas.recycle()
64
64
 
65
65
  } else {
66
66
 
67
- if (fill) this.__.__isFills ? Paint.fills(this, canvas, fill as ILeafPaint[]) : Paint.fill(this, canvas, fill as string)
67
+ if (fill) this.__.__isFills ? Paint.fills(fill as ILeafPaint[], this, canvas) : Paint.fill(fill as string, this, canvas)
68
68
  if (__drawAfterFill) this.__drawAfterFill(canvas, options)
69
- if (stroke) this.__.__isStrokes ? Paint.strokes(this, canvas, stroke as ILeafStrokePaint[]) : Paint.stroke(this, canvas, stroke as string)
69
+ if (stroke) this.__.__isStrokes ? Paint.strokes(stroke as ILeafStrokePaint[], this, canvas, options) : Paint.stroke(stroke as string, this, canvas, options)
70
70
 
71
71
  }
72
72
 
@@ -78,17 +78,17 @@ export const UIRender: IUIRenderModule = {
78
78
  }
79
79
  },
80
80
 
81
- __renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void {
81
+ __renderShape(canvas: ILeaferCanvas, renderOptions: IRenderOptions): void {
82
82
  if (!this.__worldOpacity) return
83
83
 
84
- canvas.setWorld(this.__world, options.matrix)
84
+ canvas.setWorld(this.__world, renderOptions.matrix)
85
85
 
86
86
  const { fill, stroke } = this.__
87
87
 
88
88
  this.__drawRenderPath(canvas)
89
89
 
90
- if (fill) Paint.fill(this, canvas, '#000000')
91
- if (stroke) Paint.stroke(this, canvas, '#000000')
90
+ if (fill) this.__.__pixelFill ? Paint.fills(fill as ILeafPaint[], this, canvas) : Paint.fill('#000000', this, canvas)
91
+ if (stroke) this.__.__pixelStroke ? Paint.strokes(stroke as ILeafStrokePaint[], this, canvas, renderOptions) : Paint.stroke('#000000', this, canvas, renderOptions)
92
92
  }
93
93
 
94
94
  }