#9924 Fixed visual console links

This commit is contained in:
Daniel Maya 2023-01-23 12:08:29 +01:00
parent 1d61ef11e7
commit 6b9cd42a3f
4 changed files with 38 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -821,15 +821,34 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
prevProps: Props | null = null,
prevMeta: ItemMeta | null = null
): void {
if (
prevProps &&
(prevProps.type == ItemType.LINE_ITEM ||
prevProps.type == ItemType.NETWORK_LINK)
) {
this.updateDomElement(this.childElementRef);
}
// Move box.
if (!prevProps || this.positionChanged(prevProps, this.props)) {
this.moveElement(this.props.x, this.props.y);
this.updateDomElement(this.childElementRef);
if (
prevProps &&
prevProps.type != ItemType.LINE_ITEM &&
prevProps.type != ItemType.NETWORK_LINK
) {
this.updateDomElement(this.childElementRef);
}
}
// Resize box.
if (!prevProps || this.sizeChanged(prevProps, this.props)) {
this.resizeElement(this.props.width, this.props.height);
this.updateDomElement(this.childElementRef);
if (
prevProps &&
prevProps.type != ItemType.LINE_ITEM &&
prevProps.type != ItemType.NETWORK_LINK
) {
this.updateDomElement(this.childElementRef);
}
}
// Change label.
const oldLabelHtml = this.labelElementRef.innerHTML;

View File

@ -558,6 +558,20 @@ export default class VisualConsole {
delete this.lineLinks[i];
}
}
if (
(this.lineLinks[i][line].start != itemAtStart &&
this.lineLinks[i][line].end == itemAtEnd) ||
(this.lineLinks[i][line].start == itemAtStart &&
this.lineLinks[i][line].end != itemAtEnd)
) {
// Object not connected to a line.
delete this.lineLinks[i][line];
if (Object.keys(this.lineLinks[i]).length === 0) {
delete this.lineLinks[i];
}
}
}
}
} catch (error) {