@leafer-in/editor 1.4.1 → 1.4.2

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.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "@leafer-in/editor",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -34,9 +34,9 @@
34
34
  "leaferjs"
35
35
  ],
36
36
  "peerDependencies": {
37
- "@leafer-ui/core": "^1.4.1",
38
- "@leafer-in/resize": "^1.4.1",
39
- "@leafer-ui/interface": "^1.4.1",
40
- "@leafer-in/interface": "^1.4.1"
37
+ "@leafer-ui/core": "^1.4.2",
38
+ "@leafer-in/resize": "^1.4.2",
39
+ "@leafer-ui/interface": "^1.4.2",
40
+ "@leafer-in/interface": "^1.4.2"
41
41
  }
42
42
  }
@@ -9,6 +9,11 @@ const bounds = new Bounds()
9
9
  export function simulate(editor: IEditor) {
10
10
  const { simulateTarget, list } = editor
11
11
  const { zoomLayer } = list[0].leafer.zoomLayer as IGroup // follow zoomLayer zoom / move
12
- simulateTarget.safeChange(() => simulateTarget.reset(bounds.setListWithFn(list, (leaf: ILeaf) => leaf.getBounds('box', 'page')).get()))
12
+ simulateTarget.safeChange(() => {
13
+ bounds.setListWithFn(list, (leaf: ILeaf) => leaf.getBounds('box', 'page'))
14
+ if (bounds.width === 0) bounds.width = 0.1 // fix
15
+ if (bounds.height === 0) bounds.height = 0.1
16
+ simulateTarget.reset(bounds.get())
17
+ })
13
18
  zoomLayer.add(simulateTarget)
14
19
  }