@leafer-ui/effect 1.0.0-rc.3 → 1.0.0-rc.4

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-rc.3",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "@leafer-ui/effect",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.0.0-rc.3"
25
+ "@leafer/core": "1.0.0-rc.4"
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.4",
29
+ "@leafer-ui/interface": "1.0.0-rc.4"
30
30
  }
31
31
  }
@@ -9,7 +9,7 @@ import { drawWorldShadow } from './Shadow'
9
9
  const { toOffsetOutBounds } = BoundsHelper
10
10
  const offsetOutBounds = {} as IOffsetBoundsData
11
11
 
12
- export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, _options: IRenderOptions): void {
12
+ export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void {
13
13
 
14
14
  let copyBounds: IBoundsData, spreadScale: number
15
15
 
@@ -45,7 +45,7 @@ export function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape
45
45
 
46
46
  other.fillWorld(copyBounds, item.color, 'source-in')
47
47
 
48
- if (ui.__hasMirror) {
48
+ if (ui.__hasMirror || renderOptions.matrix) {
49
49
  current.copyWorldByReset(other, copyBounds, __world, item.blendMode)
50
50
  } else {
51
51
  current.copyWorldToInner(other, copyBounds as IMatrixWithBoundsData, __layout.renderBounds, item.blendMode)
package/src/Shadow.ts CHANGED
@@ -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, _options: IRenderOptions): void {
11
+ export function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void {
12
12
 
13
13
  let copyBounds: IBoundsData, spreadScale: number
14
14
 
@@ -44,7 +44,7 @@ export function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, _op
44
44
  worldCanvas ? other.copyWorld(worldCanvas, __world, __world, 'destination-out') : other.copyWorld(shape.canvas, shapeBounds, bounds, 'destination-out')
45
45
  }
46
46
 
47
- if (ui.__hasMirror) {
47
+ if (ui.__hasMirror || renderOptions.matrix) {
48
48
  current.copyWorldByReset(other, copyBounds, __world, item.blendMode)
49
49
  } else {
50
50
  current.copyWorldToInner(other, copyBounds as IMatrixWithBoundsData, __layout.renderBounds, item.blendMode)
package/types/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { ILeaferCanvas, IRenderOptions } from '@leafer/interface';
2
2
  import { IUI, ICachedShape } from '@leafer-ui/interface';
3
3
 
4
- declare function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, _options: IRenderOptions): void;
4
+ declare function shadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
5
5
 
6
- declare function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, _options: IRenderOptions): void;
6
+ declare function innerShadow(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, renderOptions: IRenderOptions): void;
7
7
 
8
8
  declare function blur(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas): void;
9
9