diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-08-09 11:47:56 +0000 |
|---|---|---|
| committer | Javiertxo <jtx@jtx.marker.es> | 2013-08-09 11:47:56 +0000 |
| commit | 4e358f420a7a1512c722d9eccd864416bc4c075b (patch) | |
| tree | 223e826158e09ab2c864abf0214fe1e6a714ab61 /src/svg | |
| parent | Update to trunk (diff) | |
| parent | Remove missing files from POTFILES.in (diff) | |
| download | inkscape-4e358f420a7a1512c722d9eccd864416bc4c075b.tar.gz inkscape-4e358f420a7a1512c722d9eccd864416bc4c075b.zip | |
update to trunk
(bzr r11950.1.127)
Diffstat (limited to 'src/svg')
| -rw-r--r-- | src/svg/svg-length.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp index d2f4332d8..ea438e91a 100644 --- a/src/svg/svg-length.cpp +++ b/src/svg/svg-length.cpp @@ -23,7 +23,7 @@ #include "svg.h" #include "stringstream.h" -#include "../unit-constants.h" +#include "util/units.h" static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, float *val, float *computed, char **next); @@ -330,6 +330,8 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *next = (char *) e + 1; } return 1; + } else if (g_ascii_isspace(e[0])) { + return 0; // spaces are not allowed } else { /* Unitless */ if (unit) { @@ -365,7 +367,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::PT; } if (computed) { - *computed = v * PX_PER_PT; + *computed = v * Inkscape::Util::Quantity::convert(1, "pt", "px"); } break; case UVAL('p','c'): @@ -373,7 +375,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::PC; } if (computed) { - *computed = v * PX_PER_PC; + *computed = v * Inkscape::Util::Quantity::convert(1, "pc", "px"); } break; case UVAL('m','m'): @@ -381,7 +383,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::MM; } if (computed) { - *computed = v * PX_PER_MM; + *computed = v * Inkscape::Util::Quantity::convert(1, "mm", "px"); } break; case UVAL('c','m'): @@ -389,7 +391,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::CM; } if (computed) { - *computed = v * PX_PER_CM; + *computed = v * Inkscape::Util::Quantity::convert(1, "cm", "px"); } break; case UVAL('i','n'): @@ -397,7 +399,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::INCH; } if (computed) { - *computed = v * PX_PER_IN; + *computed = v * Inkscape::Util::Quantity::convert(1, "in", "px"); } break; case UVAL('f','t'): @@ -405,7 +407,7 @@ static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, *unit = SVGLength::FOOT; } if (computed) { - *computed = v * PX_PER_FT; + *computed = v * Inkscape::Util::Quantity::convert(1, "ft", "px"); } break; case UVAL('e','m'): |
