diff options
| author | Peter Moulder <peter.moulder@monash.edu> | 2008-06-05 06:30:03 +0000 |
|---|---|---|
| committer | pjrm <pjrm@users.sourceforge.net> | 2008-06-05 06:30:03 +0000 |
| commit | 0f6efd1e78ee1e6df2748ce98341568240c2ed81 (patch) | |
| tree | 52c90190246779c0f416b6150ed676a02623e9bf /src | |
| parent | fix compile with g++-4.3. (diff) | |
| download | inkscape-0f6efd1e78ee1e6df2748ce98341568240c2ed81.tar.gz inkscape-0f6efd1e78ee1e6df2748ce98341568240c2ed81.zip | |
slight numerical improvement
(bzr r5811)
Diffstat (limited to 'src')
| -rw-r--r-- | src/svg/svg-path-test.h | 2 | ||||
| -rw-r--r-- | src/svg/svg-path.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/svg/svg-path-test.h b/src/svg/svg-path-test.h index ec9536f0f..5247ace83 100644 --- a/src/svg/svg-path-test.h +++ b/src/svg/svg-path-test.h @@ -431,7 +431,7 @@ public: bpath = sp_svg_read_path("M .01,.02 L 0.04,0.02 L.04,.08L0.01,0.08 z""M 1e-2,.2e-1 L 0.004e1,0.0002e+2 L04E-2,.08e0L1.0e-2,80e-3 z");
path_str = sp_svg_write_path(bpath);
new_bpath = sp_svg_read_path(path_str);
- TS_ASSERT(bpathEqual(bpath, new_bpath, 1e-16));
+ TS_ASSERT(bpathEqual(bpath, new_bpath, 1e-17));
g_free(bpath); g_free(path_str); g_free(new_bpath);
}
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp index 61f45d460..bd0d4a4f5 100644 --- a/src/svg/svg-path.cpp +++ b/src/svg/svg-path.cpp @@ -471,7 +471,10 @@ static char const* rsvg_parse_unsigned_float(double *val, char const *begin) { exp += (int)exponent; } } - *val = (double)intval * pow(10., exp); + + *val = ( exp < 0 + ? intval / pow(10, -exp) + : intval * pow(10, exp) ); return end_of_num; } |
