@leafer-in/editor 1.11.2 → 1.12.1

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-in/editor",
3
- "version": "1.11.2",
3
+ "version": "1.12.1",
4
4
  "description": "@leafer-in/editor",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -34,10 +34,10 @@
34
34
  "leaferjs"
35
35
  ],
36
36
  "peerDependencies": {
37
- "@leafer-ui/draw": "^1.11.2",
38
- "@leafer-ui/core": "^1.11.2",
39
- "@leafer-in/resize": "^1.11.2",
40
- "@leafer-ui/interface": "^1.11.2",
41
- "@leafer-in/interface": "^1.11.2"
37
+ "@leafer-ui/draw": "^1.12.1",
38
+ "@leafer-ui/core": "^1.12.1",
39
+ "@leafer-in/resize": "^1.12.1",
40
+ "@leafer-ui/interface": "^1.12.1",
41
+ "@leafer-in/interface": "^1.12.1"
42
42
  }
43
43
  }
@@ -7,7 +7,7 @@ import { targetAttr } from '../decorator/data'
7
7
 
8
8
 
9
9
  const { abs } = Math
10
- const { copy, scale } = MatrixHelper
10
+ const { copy } = MatrixHelper
11
11
  const { setListWithFn } = BoundsHelper
12
12
  const { worldBounds } = LeafBoundsHelper
13
13
  const matrix = getMatrixData() as IMatrixWithOptionHalfData
@@ -62,27 +62,13 @@ export class Stroker extends UI implements IStroker {
62
62
  copy(matrix, worldTransform)
63
63
  matrix.half = strokeWidth % 2
64
64
 
65
- if (aScaleX !== aScaleY) { // need no scale stroke, use rect path
65
+ canvas.setWorld(matrix, options.matrix)
66
+ canvas.beginPath()
66
67
 
67
- scale(matrix, 1 / aScaleX, 1 / aScaleY)
68
- canvas.setWorld(matrix, options.matrix)
69
- canvas.beginPath()
70
- data.strokeWidth = strokeWidth
68
+ if (leaf.__.__useArrow) leaf.__drawPath(canvas)
69
+ else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas)
71
70
 
72
- const { x, y, width, height } = leaf.__layout.boxBounds
73
- canvas.rect(x * aScaleX, y * aScaleY, width * aScaleX, height * aScaleY)
74
-
75
- } else {
76
-
77
- canvas.setWorld(matrix, options.matrix)
78
- canvas.beginPath()
79
-
80
- if (leaf.__.__useArrow) leaf.__drawPath(canvas)
81
- else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas)
82
-
83
- data.strokeWidth = strokeWidth / abs(worldTransform.scaleX)
84
-
85
- }
71
+ data.strokeWidth = strokeWidth / Math.max(aScaleX, aScaleY)
86
72
 
87
73
  if (stroke) isString(stroke) ? Paint.stroke(stroke, this, canvas, options) : Paint.strokes(stroke, this, canvas, options)
88
74
  if (fill) isString(fill) ? Paint.fill(fill, this, canvas, options) : Paint.fills(fill, this, canvas, options)