@leafer-ui/data 2.0.2 → 2.0.3

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/UIData.ts +9 -6
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.3",
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.3",
26
+ "@leafer-ui/external": "2.0.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.0.2",
30
- "@leafer-ui/interface": "2.0.2"
29
+ "@leafer/interface": "2.0.3",
30
+ "@leafer-ui/interface": "2.0.3"
31
31
  }
32
32
  }
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