@leafer-ui/effect 1.9.8 → 1.9.9
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 +5 -5
- package/src/InnerShadow.ts +4 -4
- package/src/Shadow.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/effect",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.9",
|
|
4
4
|
"description": "@leafer-ui/effect",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.9.
|
|
26
|
-
"@leafer-ui/draw": "1.9.
|
|
25
|
+
"@leafer/core": "1.9.9",
|
|
26
|
+
"@leafer-ui/draw": "1.9.9"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.9.
|
|
30
|
-
"@leafer-ui/interface": "1.9.
|
|
29
|
+
"@leafer/interface": "1.9.9",
|
|
30
|
+
"@leafer-ui/interface": "1.9.9"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/InnerShadow.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { IBoundsData, IMatrixData, ILeaferCanvas, IOffsetBoundsData } from '@lea
|
|
|
2
2
|
import { BoundsHelper, LeafHelper } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IUI, ICachedShape } from '@leafer-ui/interface'
|
|
5
|
-
import { ColorConvert } from '@leafer-ui/draw'
|
|
5
|
+
import { ColorConvert, Effect } from '@leafer-ui/draw'
|
|
6
6
|
|
|
7
|
-
import { drawWorldShadow, getShadowRenderSpread
|
|
7
|
+
import { drawWorldShadow, getShadowRenderSpread } from './Shadow'
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
const { toOffsetOutBounds } = BoundsHelper
|
|
@@ -34,9 +34,9 @@ export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape
|
|
|
34
34
|
|
|
35
35
|
other.save()
|
|
36
36
|
|
|
37
|
-
other.setWorldShadow((offsetOutBounds.offsetX + item.x * scaleX * otherScale), (offsetOutBounds.offsetY + item.y * scaleY * otherScale), item.blur * scaleX * otherScale)
|
|
37
|
+
other.setWorldShadow((offsetOutBounds.offsetX + (item.x || 0) * scaleX * otherScale), (offsetOutBounds.offsetY + (item.y || 0) * scaleY * otherScale), (item.blur || 0) * scaleX * otherScale)
|
|
38
38
|
|
|
39
|
-
transform = getShadowTransform(ui, other, shape, item, offsetOutBounds, otherScale, true)
|
|
39
|
+
transform = Effect.getShadowTransform(ui, other, shape, item, offsetOutBounds, otherScale, true)
|
|
40
40
|
if (transform) other.setTransform(transform)
|
|
41
41
|
|
|
42
42
|
drawWorldShadow(other, offsetOutBounds, shape)
|
package/src/Shadow.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { IBoundsData, IFourNumber, ILeaferCanvas, IMatrixData, IOffsetBoundsData
|
|
|
2
2
|
import { BoundsHelper, LeafHelper, Matrix, Platform } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IUI, ICachedShape, ILeafShadowEffect } from '@leafer-ui/interface'
|
|
5
|
-
import { ColorConvert } from '@leafer-ui/draw'
|
|
5
|
+
import { ColorConvert, Effect } from '@leafer-ui/draw'
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
const { copy, move, toOffsetOutBounds } = BoundsHelper, { max } = Math
|
|
@@ -31,9 +31,9 @@ export function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): vo
|
|
|
31
31
|
if (sx > 1) otherScale = 1 / sx
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
other.setWorldShadow((offsetOutBounds.offsetX + item.x * scaleX * otherScale), (offsetOutBounds.offsetY + item.y * scaleY * otherScale), item.blur * scaleX * otherScale, ColorConvert.string(item.color))
|
|
34
|
+
other.setWorldShadow((offsetOutBounds.offsetX + (item.x || 0) * scaleX * otherScale), (offsetOutBounds.offsetY + (item.y || 0) * scaleY * otherScale), (item.blur || 0) * scaleX * otherScale, ColorConvert.string(item.color))
|
|
35
35
|
|
|
36
|
-
transform = getShadowTransform(ui, other, shape, item, offsetOutBounds, otherScale)
|
|
36
|
+
transform = Effect.getShadowTransform(ui, other, shape, item, offsetOutBounds, otherScale)
|
|
37
37
|
if (transform) other.setTransform(transform)
|
|
38
38
|
|
|
39
39
|
drawWorldShadow(other, offsetOutBounds, shape)
|