Skip to content

Commit

Permalink
Fix nodes min and max dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
madopew authored Dec 15, 2023
1 parent d48b838 commit 25744ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,10 @@ export class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewIn
}

if (this.nodeMaxHeight) {
node.dimension.height = Math.max(node.dimension.height, this.nodeMaxHeight);
node.dimension.height = Math.min(node.dimension.height, this.nodeMaxHeight);
}
if (this.nodeMinHeight) {
node.dimension.height = Math.min(node.dimension.height, this.nodeMinHeight);
node.dimension.height = Math.max(node.dimension.height, this.nodeMinHeight);
}

if (this.nodeWidth) {
Expand Down Expand Up @@ -697,10 +697,10 @@ export class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewIn
}

if (this.nodeMaxWidth) {
node.dimension.width = Math.max(node.dimension.width, this.nodeMaxWidth);
node.dimension.width = Math.min(node.dimension.width, this.nodeMaxWidth);
}
if (this.nodeMinWidth) {
node.dimension.width = Math.min(node.dimension.width, this.nodeMinWidth);
node.dimension.width = Math.max(node.dimension.width, this.nodeMinWidth);
}
});
}
Expand Down

0 comments on commit 25744ce

Please sign in to comment.