Skip to content

Commit

Permalink
nad-viewer: fix calling move callback, fix boundary node moving (#113)
Browse files Browse the repository at this point in the history
* Fix method for calling node move callback in network area diagram viewer
* Fix redraw when boundary node moved

Signed-off-by: massimo.ferraro <massimo.ferraro@soft.it>
Co-authored-by: Florian Dupuy <florian.dupuy@rte-france.com>
  • Loading branch information
massimo-ferraro and flo-dup authored Nov 5, 2024
1 parent 90823d3 commit 8bdd804
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ export class NetworkAreaDiagramViewer {
// if dangling line edge -> redraw boundary node
if (edgeType == DiagramUtils.EdgeType.DANGLING_LINE) {
this.redrawBoundaryNode(edgeNodes[1], DiagramUtils.getAngle(edgeStart2, edgeMiddle), nodeRadius2[1]);
if (this.selectedElement?.id == edgeNodes[1]?.id) {
// if boudary node moved -> redraw other voltage level node
if (this.draggedElement?.id == edgeNodes[1]?.id) {
// if boundary node moved -> redraw other voltage level node
this.redrawOtherVoltageLevelNode(edgeNodes[0], [edge]);
}
} else {
Expand Down Expand Up @@ -1191,7 +1191,7 @@ export class NetworkAreaDiagramViewer {
private updateNodeMetadataCallCallback(mousePosition: Point, callMoveNodeCallback: boolean) {
// get moved node from metadata
const node: NodeMetadata | undefined = this.diagramMetadata?.nodes.find(
(node) => node.svgId == this.selectedElement?.id
(node) => node.svgId == this.draggedElement?.id
);
if (node != null) {
const nodeMove = DiagramUtils.getNodeMove(node, mousePosition);
Expand Down

0 comments on commit 8bdd804

Please sign in to comment.