mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 18:03:14 +08:00
Graph: Do not let nodes get stuck
Nodes which have a pos < 0, are no longer force directed. This make the graph behave strangely. It's better to just push it a little further from the edge.
This commit is contained in:
@ -328,9 +328,11 @@ bool _updateGraphPositions(Graph g) {
|
||||
|
||||
// print('${node.label} $dx $dy');
|
||||
if (node.x - dx <= g.nodeSize / 2) {
|
||||
node.x = (g.nodeSize / 2) + 1;
|
||||
continue;
|
||||
}
|
||||
if (node.y - dy <= g.nodeSize / 2) {
|
||||
node.y = (g.nodeSize / 2) + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user