Ticket #86: placement-invalid.patch

File placement-invalid.patch, 1.1 kB (added by jburgess, 8 months ago)

Patch to disallow placement if segment_length=0

  • src/placement_finder.cpp

     
    561561      double dy = new_y - old_y; 
    562562       
    563563      double segment_length = path_distances[index]; 
     564      if (segment_length == 0) { 
     565          // Not allowed to place across on 0 length segments or discontinuities 
     566          return std::auto_ptr<placement_element>(NULL); 
     567      } 
    564568       
    565569      current_placement->starting_x = old_x + dx*distance/segment_length; 
    566570      current_placement->starting_y = old_y + dy*distance/segment_length; 
     
    584588         c = ci.character; 
    585589 
    586590         //Coordinates this character will start at 
     591        if (segment_length == 0) { 
     592            // Not allowed to place across on 0 length segments or discontinuities 
     593            return std::auto_ptr<placement_element>(NULL); 
     594        } 
    587595         double start_x = old_x + dx*distance/segment_length; 
    588596         double start_y = old_y + dy*distance/segment_length; 
    589597         //Coordinates this character ends at, calculated below