Skip to content

Commit

Permalink
Fix issue with panzoom
Browse files Browse the repository at this point in the history
Signed-off-by: massimo.ferraro <[email protected]>
  • Loading branch information
massimo-ferraro authored and flo-dup committed Nov 4, 2024
1 parent 07f227b commit 13f3bca
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,18 +403,21 @@ export class NetworkAreaDiagramViewer {
}

private handleEndDragSelectEvent(event: Event) {
if (!this.shiftKeyOnMouseDown) {
// moving node
const newPosition = this.getMousePosition(event as MouseEvent);
this.completeDrag(newPosition, true);
} else {
// selecting node
this.completeSelect();
// check if I moved or selected an element
if (this.selectedElement) {
if (!this.shiftKeyOnMouseDown) {
// moving node
const newPosition = this.getMousePosition(event as MouseEvent);
this.completeDrag(newPosition, true);
} else {
// selecting node
this.completeSelect();
}
// change cursor style
const svg: HTMLElement = <HTMLElement>this.svgDraw?.node.firstElementChild?.parentElement;
svg.style.removeProperty('cursor');
this.enablePanzoom();
}
// change cursor style
const svg: HTMLElement = <HTMLElement>this.svgDraw?.node.firstElementChild?.parentElement;
svg.style.removeProperty('cursor');
this.enablePanzoom();
}

private completeDrag(newPosition: Point, callMoveNodeCallback: boolean) {
Expand Down

0 comments on commit 13f3bca

Please sign in to comment.