@leafer-ui/effect 1.9.10 → 1.9.11

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/Shadow.ts +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/effect",
3
- "version": "1.9.10",
3
+ "version": "1.9.11",
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.10",
26
- "@leafer-ui/draw": "1.9.10"
25
+ "@leafer/core": "1.9.11",
26
+ "@leafer-ui/draw": "1.9.11"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.9.10",
30
- "@leafer-ui/interface": "1.9.10"
29
+ "@leafer/interface": "1.9.11",
30
+ "@leafer-ui/interface": "1.9.11"
31
31
  }
32
32
  }
package/src/Shadow.ts CHANGED
@@ -79,15 +79,14 @@ export function getShadowRenderSpread(_ui: IUI, shadow: ILeafShadowEffect[]): IF
79
79
 
80
80
  export function getShadowTransform(ui: IUI, canvas: ILeaferCanvas, _shape: ICachedShape, shadow: ILeafShadowEffect, outBounds: IBoundsData, otherScale: number, isInnerShaodw?: boolean): IMatrixData {
81
81
  if (shadow.spread) {
82
- const spreadScale = 1 + shadow.spread * 2 / ui.__layout.strokeBounds.width * otherScale * (isInnerShaodw ? -1 : 1)
83
- tempMatrix.set().scaleOfOuter({ x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio, y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio }, spreadScale)
82
+ const spread = shadow.spread * 2 * otherScale * (isInnerShaodw ? -1 : 1), { width, height } = ui.__layout.strokeBounds
83
+ tempMatrix.set().scaleOfOuter({ x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio, y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio }, 1 + spread / width, 1 + spread / height)
84
84
  return tempMatrix
85
85
  }
86
86
  return undefined
87
87
  }
88
88
 
89
89
  export function drawWorldShadow(canvas: ILeaferCanvas, outBounds: IBoundsData, shape: ICachedShape): void {
90
-
91
90
  const { shapeBounds } = shape
92
91
  let from: IBoundsData, to: IBoundsData
93
92