diff options
| author | Ted Gould <ted@gould.cx> | 2008-10-28 04:45:31 +0000 |
|---|---|---|
| committer | Ted Gould <ted@canonical.com> | 2008-10-28 04:45:31 +0000 |
| commit | dc743aafd8b8c2d9c4e081fc937a94a26c055203 (patch) | |
| tree | 98748c7465ac4ce06d1cbc359f767bcf0422cc85 /src/2geom/point.cpp | |
| parent | From trunk (diff) | |
| download | inkscape-dc743aafd8b8c2d9c4e081fc937a94a26c055203.tar.gz inkscape-dc743aafd8b8c2d9c4e081fc937a94a26c055203.zip | |
Merge from trunk
(bzr r6886)
Diffstat (limited to 'src/2geom/point.cpp')
| -rw-r--r-- | src/2geom/point.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/2geom/point.cpp b/src/2geom/point.cpp index 42a7ecef3..5dd7b52f2 100644 --- a/src/2geom/point.cpp +++ b/src/2geom/point.cpp @@ -6,7 +6,7 @@ namespace Geom { -/** Scales this vector to make it a unit vector (within rounding error). +/** \brief Scales this vector to make it a unit vector (within rounding error). * * The current version tries to handle infinite coordinates gracefully, * but it's not clear that any callers need that. @@ -38,23 +38,23 @@ void Point::normalize() { } } switch (n_inf_coords) { - case 0: { - /* Can happen if both coords are near +/-DBL_MAX. */ - *this /= 4.0; - len = hypot(_pt[0], _pt[1]); - assert(len != inf); - *this /= len; - break; - } - case 1: { - *this = tmp; - break; - } - case 2: { - *this = tmp * sqrt(0.5); - break; + case 0: { + /* Can happen if both coords are near +/-DBL_MAX. */ + *this /= 4.0; + len = hypot(_pt[0], _pt[1]); + assert(len != inf); + *this /= len; + break; + } + case 1: { + *this = tmp; + break; + } + case 2: { + *this = tmp * sqrt(0.5); + break; + } } - } } } |
