@leafer-ui/render 1.8.0 → 1.9.1
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 +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/render",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
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.
|
|
25
|
+
"@leafer-ui/external": "1.9.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.
|
|
29
|
-
"@leafer-ui/interface": "1.
|
|
28
|
+
"@leafer/interface": "1.9.1",
|
|
29
|
+
"@leafer-ui/interface": "1.9.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/UIRender.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILeaferCanvas, IRenderOptions } from '@leafer/interface'
|
|
2
|
-
import { DataHelper } from '@leafer/core'
|
|
2
|
+
import { DataHelper, isArray } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IUIRenderModule, ILeafPaint, ILeafStrokePaint, IUI } from '@leafer-ui/interface'
|
|
5
5
|
import { Paint, Effect, Filter, ColorConvert } from '@leafer-ui/external'
|
|
@@ -19,7 +19,7 @@ export const UIRender: IUIRenderModule = {
|
|
|
19
19
|
|
|
20
20
|
if (data.__useEffect) {
|
|
21
21
|
const { shadow, fill, stroke } = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter
|
|
22
|
-
stintSet(data, '__isFastShadow', shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && fill && !data.__isTransparentFill && !(fill
|
|
22
|
+
stintSet(data, '__isFastShadow', shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || (stroke && data.strokeAlign === 'inside'))) // 高性能阴影条件, @leafer-ui/image check.ts 中的 allowDraw 逻辑需与此处关联
|
|
23
23
|
data.__useEffect = !!(shadow || otherEffect)
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -72,7 +72,7 @@ export const UIRender: IUIRenderModule = {
|
|
|
72
72
|
if (__fillAfterStroke) data.__isStrokes ? Paint.strokes(stroke as ILeafStrokePaint[], this, canvas) : Paint.stroke(stroke as string, this, canvas)
|
|
73
73
|
|
|
74
74
|
if (__isFastShadow) {
|
|
75
|
-
const shadow = data.shadow[0], { scaleX, scaleY } = this.
|
|
75
|
+
const shadow = data.shadow[0], { scaleX, scaleY } = this.getRenderScaleData(true, shadow.scaleFixed)
|
|
76
76
|
canvas.save(), canvas.setWorldShadow(shadow.x * scaleX, shadow.y * scaleY, shadow.blur * scaleX, ColorConvert.string(shadow.color))
|
|
77
77
|
}
|
|
78
78
|
|