Changeset 11187 in josm


Ignore:
Timestamp:
2016-10-29T22:13:16+02:00 (8 months ago)
Author:
bastiK
Message:

fixed #13864 - distribute nodes goes into infinite loop if 2 nodes have the same coordinates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/DistributeAction.java

    r10467 r11187  
    211211        // Find from the selected nodes two that are the furthest apart.
    212212        // Let's call them A and B.
    213         double distance = 0;
     213        double distance = Double.NEGATIVE_INFINITY;
    214214
    215215        Node nodea = null;
     
    256256
    257257            // Find the node that is furthest from B (i.e. closest to A)
    258             distance = 0.0;
     258            distance = Double.NEGATIVE_INFINITY;
    259259            for (Node n : nodes) {
    260260                double dist = Math.sqrt(nodeb.getEastNorth().distance(n.getEastNorth()));
Note: See TracChangeset for help on using the changeset viewer.