Skip to content

Commit

Permalink
fix(core): anchorId missed after point adjusting(#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
wumail authored and boyongjiong committed Nov 1, 2023
1 parent cc84fe8 commit d7778cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/core/src/type/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export type EdgeData = {
properties: Record<string, unknown>;
zIndex?: number;
pointsList?: Point[]; // 折线、曲线会输出pointsList
[key: string]: unknown;
};
// 边属性
export type EdgeAttribute = {
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/view/edge/AdjustPoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ export default class AdjustPoint extends Component<IProps, IState> {
if (info && info.node) {
const { pass, msg, newTargetNode } = this.isAllowAdjust(info);
if (pass) {
const edgeData = edgeModel.getData();
const { text, sourceAnchorId = '', targetAnchorId = '', ...rest } = edgeModel.getData();
createEdgeInfo = {
...edgeData,
sourceAnchorId: '',
targetAnchorId: '',
text: edgeData?.text?.value || '',
sourceAnchorId,
targetAnchorId,
...rest,
text: text?.value || '',
};
// 根据调整点是边的起点或重点,计算创建边需要的参数
if (type === AdjustType.SOURCE) {
Expand Down

0 comments on commit d7778cc

Please sign in to comment.