Ignore:
Timestamp:
2010-05-19T22:28:31+02:00 (15 years ago)
Author:
lambertus
Message:

'Fix crash when adding a single address to an odd shaped building. See also #2496'

Location:
applications/editors/josm/plugins/terracer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/terracer/build.xml

    r21169 r21376  
    3232
    3333
    34     <property name="commit.message" value="Fix the message text (and remove the now redundant message popup)" />
     34    <property name="commit.message" value="Fix crash when adding a single address to an odd shaped building. See also #2496" />
    3535    <property name="plugin.main.version" value="3210" />
    3636
  • applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java

    r21163 r21376  
    203203                            + " from " + from + " to " + to + " step " + step);
    204204        }
    205                
    206         // now find which is the longest side connecting the first node
    207         Pair<Way, Way> interp = findFrontAndBack(outline);
    208 
    209         final double frontLength = wayLength(interp.a);
    210         final double backLength = wayLength(interp.b);
    211205
    212206        // new nodes array to hold all intermediate nodes
     
    216210        Collection<Way> ways = new LinkedList<Way>();
    217211
     212                // Should this building be terraced (i.e. is there more then one section?)
    218213                if (nb > 1) {
    219214                    // create intermediate nodes by interpolating.
     215                   
     216                    // now find which is the longest side connecting the first node
     217                        Pair<Way, Way> interp = findFrontAndBack(outline);
     218
     219                        final double frontLength = wayLength(interp.a);
     220                        final double backLength = wayLength(interp.b);
     221                       
    220222                    for (int i = 0; i <= nb; ++i) {
    221223                        new_nodes[0][i] = interpolateAlong(interp.a, frontLength * i / nb);
     
    254256                    }
    255257                } else {
    256                         // Single building, just add the address details
     258                        // Single section, just add the address details
    257259                        Way newOutline;
    258260                        newOutline = addressBuilding(outline, street, streetName, From);
Note: See TracChangeset for help on using the changeset viewer.