diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp
index 63af37665f02ce80858654108eebc02e15958acb..f909446675911d791382a4ca06d3150230760983 100644 (file)
--- a/src/svg/svg-length.cpp
+++ b/src/svg/svg-length.cpp
# include "config.h"
#endif
+#include <cstring>
+#include <string>
#include <math.h>
#include <glib/gstrfuncs.h>
+
#include "svg.h"
#include "stringstream.h"
#include "../unit-constants.h"
}
/* Determine the actual number of fractional digits */
- fprec = MAX(fprec, tprec - idigits);
+ fprec = MAX(fprec, tprec - idigits - 1);
/* Round value */
val += 0.5 * pow(10.0, - ((double) fprec));
/* Extract integral and fractional parts */
*unit = SVGLength::PC;
}
if (computed) {
- *computed = v * 12 * PX_PER_PT;
+ *computed = v * PX_PER_PC;
}
break;
case UVAL('m','m'):
@@ -374,6 +377,14 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit,
*computed = v * PX_PER_IN;
}
break;
+ case UVAL('f','t'):
+ if (unit) {
+ *unit = SVGLength::FOOT;
+ }
+ if (computed) {
+ *computed = v * PX_PER_FT;
+ }
+ break;
case UVAL('e','m'):
if (unit) {
*unit = SVGLength::EM;