Bug 498198 - NaN in SpringLayoutAlgorithm.computeForces(...)
Summary: NaN in SpringLayoutAlgorithm.computeForces(...)
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: 1.7.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-20 09:41 EDT by Andreas Mayer CLA
Modified: 2016-07-20 09:51 EDT (History)
0 users

See Also:


Attachments
Patch to fix this bug (1.49 KB, application/octet-stream)
2016-07-20 09:51 EDT, Andreas Mayer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Mayer CLA 2016-07-20 09:41:51 EDT
In computeForces(...), distance_sq can be 0 due to a wrong order of statements, which results in NaN forces in the following divisions by distance_sq. As a result, the algorithm sometimes places all nodes at (0, 0). 

This problem was fixed when the code was revised for GEF4 Zest, but is still present in GEF 3/Zest 1.
Comment 1 Andreas Mayer CLA 2016-07-20 09:51:31 EDT
Created attachment 263210 [details]
Patch to fix this bug