@zhangqingcq/vgce 0.1.21 → 0.1.23

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": "@zhangqingcq/vgce",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Vector graphics configure editor. svg组态编辑器。基于vue3.3+ts+element-plus+vite",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -651,9 +651,16 @@
651
651
  globalStore.setDoneJson(globalStore.done_json)
652
652
  } else if (globalStore.intention == EGlobalStoreIntention.GroupMove) {
653
653
  if (groupMoved) {
654
- //群组移动了
654
+ //群组移动了,从新计算移动过的组件各种坐标信息
655
+ for (let e of globalStore.done_json) {
656
+ if (e.selected) {
657
+ setSvgActualInfo(e)
658
+ }
659
+ }
655
660
  groupMoved = false
656
661
  globalStore.intention = EGlobalStoreIntention.None
662
+ //记录历史记录
663
+ globalStore.setDoneJson(globalStore.done_json)
657
664
  }
658
665
  } else if (globalStore.handle_svg_info?.info && globalStore.intention == EGlobalStoreIntention.Zoom) {
659
666
  //缩放完成后重置中点 新版本中点就是组件坐标
@@ -957,6 +964,18 @@
957
964
  }
958
965
  }
959
966
 
967
+ const onHandleKeyUp = (e: KeyboardEvent) => {
968
+ const t = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']
969
+ if (!e.ctrlKey && t.indexOf(e.key) > -1) {
970
+ //群组移动了,从新计算移动过的组件各种坐标信息
971
+ for (let e of globalStore.done_json) {
972
+ if (e.selected) {
973
+ setSvgActualInfo(e)
974
+ }
975
+ }
976
+ }
977
+ }
978
+
960
979
  const resizeBox = () => {
961
980
  setSvgActualInfo(globalStore.done_json[globalStore.handle_svg_info!.index], true)
962
981
  }
@@ -991,6 +1010,7 @@
991
1010
  @mouseup="onCanvasMouseUp"
992
1011
  @contextmenu="onCanvasContextMenuEvent"
993
1012
  @keydown="onHandleKeyDown"
1013
+ @keyup="onHandleKeyUp"
994
1014
  @mousewheel="onMousewheel"
995
1015
  >
996
1016
  <slot name="background" />