Skip to content

Commit

Permalink
fix(extension): 【dynamic-group】存入history时,将text坐标恢复到未折叠前的数据(#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbccb authored and boyongjiong committed Sep 29, 2024
1 parent 691b3fa commit 36f352b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/extension/src/dynamic-group/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,15 @@ export class DynamicGroupNodeModel extends RectNodeModel<IGroupNodeProperties> {
isCollapsed,
} = this
if (isCollapsed) {
// 如果当前是折叠模式
// 存入history的时候,将坐标恢复到未折叠前的坐标数据
// 因为拿出history数据的时候,会触发collapse()进行坐标的折叠计算
data.x = x + expandWidth / 2 - collapsedWidth / 2
data.y = y + expandHeight / 2 - collapsedHeight / 2
if (data.text) {
data.text.x = data.text.x + expandWidth / 2 - collapsedWidth / 2
data.text.y = data.text.y + expandHeight / 2 - collapsedHeight / 2
}
}
return data
}
Expand Down

0 comments on commit 36f352b

Please sign in to comment.