@leafer-ui/data 2.0.2 → 2.0.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/data",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "@leafer-ui/data",
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": "2.0.2",
26
- "@leafer-ui/external": "2.0.2"
25
+ "@leafer/core": "2.0.4",
26
+ "@leafer-ui/external": "2.0.4"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.0.2",
30
- "@leafer-ui/interface": "2.0.2"
29
+ "@leafer/interface": "2.0.4",
30
+ "@leafer-ui/interface": "2.0.4"
31
31
  }
32
32
  }
package/src/StarData.ts CHANGED
@@ -4,5 +4,5 @@ import { UIData } from "./UIData"
4
4
 
5
5
 
6
6
  export class StarData extends UIData implements IStarData {
7
-
7
+ get __boxStroke(): boolean { return !(this as IStarData).__pathInputed }
8
8
  }
package/src/UIData.ts CHANGED
@@ -140,15 +140,18 @@ export class UIData extends LeafData implements IUIData {
140
140
 
141
141
 
142
142
  public __getRealStrokeWidth(childStyle?: IStrokeComputedStyle): number {
143
- let { strokeWidth, strokeWidthFixed } = this as IUIData
143
+ let { strokeWidth, strokeScaleFixed } = this as IUIData
144
144
  if (childStyle) {
145
145
  if (childStyle.strokeWidth) strokeWidth = childStyle.strokeWidth
146
- if (!isUndefined(childStyle.strokeWidthFixed)) strokeWidthFixed = childStyle.strokeWidthFixed
146
+ if (!isUndefined(childStyle.strokeScaleFixed)) strokeScaleFixed = childStyle.strokeScaleFixed
147
147
  }
148
- if (strokeWidthFixed) {
149
- const scale = this.__leaf.getClampRenderScale()
150
- return scale > 1 ? strokeWidth / scale : strokeWidth
151
- } else return strokeWidth
148
+
149
+ if (strokeScaleFixed) {
150
+ const { scaleX } = this.__leaf.getRenderScaleData(true, strokeScaleFixed, false)
151
+ if (scaleX !== 1) return strokeWidth * scaleX
152
+ }
153
+
154
+ return strokeWidth
152
155
  }
153
156
 
154
157
 
package/types/index.d.ts CHANGED
@@ -78,6 +78,7 @@ declare class PolygonData extends LineData implements IPolygonData {
78
78
  }
79
79
 
80
80
  declare class StarData extends UIData implements IStarData {
81
+ get __boxStroke(): boolean;
81
82
  }
82
83
 
83
84
  declare class PathData extends UIData implements IPathData {