@leafer-in/editor 2.2.1 → 2.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-in/editor",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
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": "^2.2.1",
38
- "@leafer-ui/core": "^2.2.1",
39
- "@leafer-in/resize": "^2.2.1",
40
- "@leafer-ui/interface": "^2.2.1",
41
- "@leafer-in/interface": "^2.2.1"
37
+ "@leafer-ui/draw": "^2.2.3",
38
+ "@leafer-ui/core": "^2.2.3",
39
+ "@leafer-in/resize": "^2.2.3",
40
+ "@leafer-ui/interface": "^2.2.3",
41
+ "@leafer-in/interface": "^2.2.3"
42
42
  }
43
43
  }
@@ -31,7 +31,10 @@ export function targetAttr(fn: IFunction) {
31
31
 
32
32
  if (t.hasDimOthers) t.cancelDimOthers()
33
33
 
34
- if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1) // fix: 单个锁定 + shift多选
34
+ if (isArray(value) && value.length > 1 && value.some(item => item.locked || item.editable === 'single')) {
35
+ value = value.filter(item => !(item.locked || item.editable === 'single')) // 锁定、单选元素不能参与多选
36
+ }
37
+
35
38
  if (t.single) {
36
39
  delete t.element.syncEventer // 重置 EditBox.load() 同步事件设置
37
40
  delete t.element.__world.ignorePixelSnap // 重置 EditBox.load() 忽略对齐像素设置
@@ -112,7 +112,8 @@ export class LineEditTool extends EditTool {
112
112
  const { from, to } = fromTo
113
113
  line.innerToWorld(from, from, false, editBox)
114
114
  line.innerToWorld(to, to, false, editBox)
115
- rect.pen.clearPath().moveTo(from.x, from.y).lineTo(to.x, to.y)
115
+ const { x, y } = editBox.rectBounds
116
+ rect.pen.clearPath().moveTo(from.x - x, from.y - y).lineTo(to.x - x, to.y - y)
116
117
  copy(resizePoints[7] as IPointData, from)
117
118
  copy(rotatePoints[7] as IPointData, from)
118
119
  copy(resizePoints[3] as IPointData, to)