@leafer-ui/effect 1.0.0-bate → 1.0.0-beta.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-ui/effect",
3
- "version": "1.0.0-bate",
3
+ "version": "1.0.0-beta.10",
4
4
  "description": "@leafer-ui/effect",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -1,13 +1,15 @@
1
- import { IBoundsData, ILeaferCanvas, IMatrixWithBoundsData, IOffsetBoundsData } from '@leafer/interface'
1
+ import { IBoundsData, ILeaferCanvas, IMatrixWithBoundsData, IOffsetBoundsData, IRenderOptions } from '@leafer/interface'
2
2
  import { BoundsHelper } from '@leafer/core'
3
3
 
4
4
  import { IUI, ICachedShape } from '@leafer-ui/interface'
5
+
5
6
  import { drawWorldShadow } from './Shadow'
6
7
 
8
+
7
9
  const { toOffsetOutBounds } = BoundsHelper
8
10
  const offsetOutBounds = {} as IOffsetBoundsData
9
11
 
10
- export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void {
12
+ export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, _options: IRenderOptions): void {
11
13
 
12
14
  let copyBounds: IBoundsData, spreadScale: number
13
15
 
@@ -26,7 +28,7 @@ export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape
26
28
 
27
29
  other.setWorldShadow((offsetOutBounds.offsetX + item.x * scaleX), (offsetOutBounds.offsetY + item.y * scaleY), item.blur * scaleX)
28
30
 
29
- spreadScale = item.spread ? 1 - item.spread * 2 / (__layout.boxBounds.width + (__layout.shapeStrokeSpread || 0) * 2) : 0
31
+ spreadScale = item.spread ? 1 - item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0
30
32
 
31
33
  drawWorldShadow(other, offsetOutBounds, spreadScale, shape)
32
34
 
package/src/Shadow.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IBoundsData, ILeaferCanvas, IMatrixWithBoundsData, IOffsetBoundsData } from '@leafer/interface'
1
+ import { IBoundsData, ILeaferCanvas, IMatrixWithBoundsData, IOffsetBoundsData, IRenderOptions } from '@leafer/interface'
2
2
  import { BoundsHelper, Platform } from '@leafer/core'
3
3
 
4
4
  import { IUI, ICachedShape } from '@leafer-ui/interface'
@@ -8,7 +8,7 @@ const { copy, toOffsetOutBounds } = BoundsHelper
8
8
  const tempBounds = {} as IBoundsData
9
9
  const offsetOutBounds = {} as IOffsetBoundsData
10
10
 
11
- export function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void {
11
+ export function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, _options: IRenderOptions): void {
12
12
 
13
13
  let copyBounds: IBoundsData, spreadScale: number
14
14
 
@@ -25,7 +25,7 @@ export function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): vo
25
25
 
26
26
  other.setWorldShadow((offsetOutBounds.offsetX + item.x * scaleX), (offsetOutBounds.offsetY + item.y * scaleY), item.blur * scaleX, item.color)
27
27
 
28
- spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.shapeStrokeSpread || 0) * 2) : 0
28
+ spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0
29
29
 
30
30
  drawWorldShadow(other, offsetOutBounds, spreadScale, shape)
31
31