Clusters have wrong position since version 8.2.3 (simple calculation issue)
adhed opened this issue · comments
Describe the bug
Clusters have wrong position on the screen.
To Reproduce
Steps to reproduce the behavior:
- Use clusters in the latest versions.
- You will see that clusters have wrong position (translate / transform properties) and depending how many nodes are in a cluster - it will be going worse and worse.
- It's a simple issue with the latest code.
Expected behavior
Clusters have proper width to wrap all the nodes inside.
Demo
https://stackblitz.com/edit/angular-kfufe3?file=src%2Fapp%2Fapp.component.ts
ngx-graph version
8.2.3 - only here, because it has been introduced in this PR: #528
Additional context
The issue is a simple wrong calculation here done for clusters: https://github.com/swimlane/ngx-graph/pull/528/files#diff-e500ec710d86f32d459d34a450582fe79dcb541617240d848fa6319a389fa46aR454
Please take a look that dividing by 2 is now done twice which causes the issue. The flag has been handled wrongly here.
This issue should be resolved in 8.2.4 @adhed. Thanks for reporting.