summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6934030)
raw | patch | inline | side by side (parent: 6934030)
author | pjrm <pjrm@users.sourceforge.net> | |
Thu, 5 Jun 2008 06:30:03 +0000 (06:30 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Thu, 5 Jun 2008 06:30:03 +0000 (06:30 +0000) |
src/svg/svg-path-test.h | patch | blob | history | |
src/svg/svg-path.cpp | patch | blob | history |
index ec9536f0ff0e41e877f09678cdc6a8d3c0385b23..5247ace83741266d7c1ecd5939db7d39bff633d3 100644 (file)
--- a/src/svg/svg-path-test.h
+++ b/src/svg/svg-path-test.h
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");\r
path_str = sp_svg_write_path(bpath);\r
new_bpath = sp_svg_read_path(path_str);\r
- TS_ASSERT(bpathEqual(bpath, new_bpath, 1e-16));\r
+ TS_ASSERT(bpathEqual(bpath, new_bpath, 1e-17));\r
g_free(bpath); g_free(path_str); g_free(new_bpath);\r
}\r
\r
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp
index 61f45d46048ac33077a920c85da46860de8c745d..bd0d4a4f5ff1dbb7c7af872f8ff6779a4ec20dba 100644 (file)
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
exp += (int)exponent;
}
}
- *val = (double)intval * pow(10., exp);
+
+ *val = ( exp < 0
+ ? intval / pow(10, -exp)
+ : intval * pow(10, exp) );
return end_of_num;
}