Changeset 343:e5f525c87eb9


Ignore:
Timestamp:
09/06/13 10:58:46 (8 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
63396634303730383537333138613230643630366361393034333563656534396566363330613436
Message:

Robustness fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/utils.py

    r334 r343  
    2121def vec_with_length(coords, length=1):
    2222    vec = Vec2d(coords)
    23     vec.length = length
     23    # Don't crash if we're created a zero length vector
     24    if vec.length != 0:
     25        vec.length = length
    2426    return vec
Note: See TracChangeset for help on using the changeset viewer.