@leafer-ui/render 1.0.0-rc.17 → 1.0.0-rc.19
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 +4 -4
- package/src/UIRender.ts +20 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/render",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.19",
|
|
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.
|
|
25
|
+
"@leafer-ui/external": "1.0.0-rc.19"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.0.0-rc.
|
|
29
|
-
"@leafer-ui/interface": "1.0.0-rc.
|
|
28
|
+
"@leafer/interface": "1.0.0-rc.19",
|
|
29
|
+
"@leafer-ui/interface": "1.0.0-rc.19"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/UIRender.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ILeaferCanvas, IRenderOptions } from '@leafer/interface'
|
|
2
2
|
|
|
3
|
-
import { IUIRenderModule, ILeafPaint, ILeafStrokePaint } from '@leafer-ui/interface'
|
|
3
|
+
import { IUIRenderModule, ILeafPaint, ILeafStrokePaint, IUI } from '@leafer-ui/interface'
|
|
4
4
|
import { Paint, Effect } from '@leafer-ui/external'
|
|
5
5
|
|
|
6
6
|
|
|
@@ -26,20 +26,13 @@ export const UIRender: IUIRenderModule = {
|
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
__drawFast(canvas: ILeaferCanvas, options: IRenderOptions): void {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.__drawRenderPath(canvas)
|
|
32
|
-
|
|
33
|
-
if (fill) Paint.fill(fill as string, this, canvas)
|
|
34
|
-
if (__drawAfterFill) this.__drawAfterFill(canvas, options)
|
|
35
|
-
if (stroke) Paint.stroke(stroke as string, this, canvas)
|
|
29
|
+
drawFast(this, canvas, options)
|
|
36
30
|
},
|
|
37
31
|
|
|
38
32
|
__draw(canvas: ILeaferCanvas, options: IRenderOptions): void {
|
|
33
|
+
const data = this.__
|
|
39
34
|
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
const data = this.__
|
|
35
|
+
if (data.__complex) {
|
|
43
36
|
|
|
44
37
|
if (data.__needComputePaint) data.__computePaint()
|
|
45
38
|
|
|
@@ -77,7 +70,11 @@ export const UIRender: IUIRenderModule = {
|
|
|
77
70
|
|
|
78
71
|
} else {
|
|
79
72
|
|
|
80
|
-
|
|
73
|
+
if (data.__pathInputed) {
|
|
74
|
+
drawFast(this, canvas, options)
|
|
75
|
+
} else {
|
|
76
|
+
this.__drawFast(canvas, options)
|
|
77
|
+
}
|
|
81
78
|
|
|
82
79
|
}
|
|
83
80
|
},
|
|
@@ -95,4 +92,15 @@ export const UIRender: IUIRenderModule = {
|
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
94
|
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
function drawFast(ui: IUI, canvas: ILeaferCanvas, options: IRenderOptions): void {
|
|
99
|
+
const { fill, stroke, __drawAfterFill } = ui.__
|
|
100
|
+
|
|
101
|
+
ui.__drawRenderPath(canvas)
|
|
102
|
+
|
|
103
|
+
if (fill) Paint.fill(fill as string, ui, canvas)
|
|
104
|
+
if (__drawAfterFill) ui.__drawAfterFill(canvas, options)
|
|
105
|
+
if (stroke) Paint.stroke(stroke as string, ui, canvas)
|
|
98
106
|
}
|