File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
app/src/core/service/controlService/controller/concrete Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11app /src-tauri
22
33# 防止翻译总是被格式化
4- app / locales / * .yml
4+ * .yml
Original file line number Diff line number Diff line change @@ -41,12 +41,16 @@ ControllerLayerMoving.mouseup = (event: MouseEvent) => {
4141 if ( entity && entity instanceof TextNode ) {
4242 const newSection = StageSectionPackManager . targetTextNodeToSection ( entity ) ;
4343 const selectedEntities = StageManager . getSelectedEntities ( ) ;
44- // StageManager.goInSection(StageManager.getSelectedEntities(), newSection);
45- StageSectionInOutManager . goInSections ( StageManager . getSelectedEntities ( ) , [ newSection ] ) ;
44+ // 获取所有选中实体的外接矩形的中心点,以便计算移动距离
45+ const centerLocation = Rectangle . getBoundingRectangle (
46+ selectedEntities . map ( ( entity ) => entity . collisionBox . getRectangle ( ) ) ,
47+ ) . center ;
4648 // 最后让所有选中的实体移动
4749 for ( const selectedEntity of selectedEntities ) {
48- selectedEntity . moveTo ( mouseLocation ) ;
50+ const delta = mouseLocation . subtract ( centerLocation ) ;
51+ selectedEntity . move ( delta ) ;
4952 }
53+ StageSectionInOutManager . goInSections ( StageManager . getSelectedEntities ( ) , [ newSection ] ) ;
5054 return ; // 这个return必须写
5155 }
5256
You can’t perform that action at this time.
0 commit comments