Changeset 343:e5f525c87eb9 for nagslang


Ignore:
Timestamp:
Sep 6, 2013, 10:58:46 AM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
c9f4070857318a20d606ca90435cee49ef630a46
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.