From 25744ce108d57082834104eac7b6c8a89a0f75c9 Mon Sep 17 00:00:00 2001 From: Madi Date: Fri, 15 Dec 2023 12:53:35 +0300 Subject: [PATCH] Fix nodes min and max dimensions --- .../swimlane/ngx-graph/src/lib/graph/graph.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts index 411e83e2..38924117 100644 --- a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts +++ b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts @@ -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) { @@ -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); } }); }