@leafer-ui/bounds 1.7.0 → 1.9.0
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 +3 -3
- package/src/UIBounds.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/bounds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "@leafer-ui/bounds",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.
|
|
25
|
+
"@leafer/core": "1.9.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer-ui/interface": "1.
|
|
28
|
+
"@leafer-ui/interface": "1.9.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/UIBounds.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const UIBounds: IUIBoundsModule = {
|
|
|
7
7
|
|
|
8
8
|
__updateStrokeSpread(): number {
|
|
9
9
|
let width = 0, boxWidth = 0
|
|
10
|
-
const data = this.__, { strokeAlign, strokeWidth } = data, box = this.__box
|
|
10
|
+
const data = this.__, { strokeAlign, __maxStrokeWidth: strokeWidth } = data, box = this.__box
|
|
11
11
|
|
|
12
12
|
if ((data.stroke || data.hitStroke === 'all') && strokeWidth && strokeAlign !== 'inside') {
|
|
13
13
|
boxWidth = width = strokeAlign === 'center' ? strokeWidth / 2 : strokeWidth
|
|
@@ -33,7 +33,7 @@ export const UIBounds: IUIBoundsModule = {
|
|
|
33
33
|
|
|
34
34
|
__updateRenderSpread(): number {
|
|
35
35
|
let width: number = 0
|
|
36
|
-
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__
|
|
36
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter, renderSpread } = this.__
|
|
37
37
|
|
|
38
38
|
if (shadow) shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5))
|
|
39
39
|
|
|
@@ -41,6 +41,8 @@ export const UIBounds: IUIBoundsModule = {
|
|
|
41
41
|
|
|
42
42
|
if (filter) width += Filter.getSpread(filter)
|
|
43
43
|
|
|
44
|
+
if (renderSpread) width += renderSpread
|
|
45
|
+
|
|
44
46
|
let shapeWidth = width = Math.ceil(width)
|
|
45
47
|
|
|
46
48
|
if (innerShadow) innerShadow.forEach(item => shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5))
|