diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-11-25 14:20:24 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-11-25 14:20:24 +0000 |
| commit | 9827a6723d62935725b67b1bf55eea08bbbab527 (patch) | |
| tree | a3f91e846fc26a5c9e1525405a710ea1422ca7e7 /src/svg/svg-length.cpp | |
| parent | Allow marker orientation to have units ('deg', 'rad', 'grad', 'turn'). (diff) | |
| download | inkscape-9827a6723d62935725b67b1bf55eea08bbbab527.tar.gz inkscape-9827a6723d62935725b67b1bf55eea08bbbab527.zip | |
Move 'm' handling code from document.cpp to svg-length.cpp and units.cpp to match handling of 'ft'.
(bzr r13758)
Diffstat (limited to 'src/svg/svg-length.cpp')
| -rw-r--r-- | src/svg/svg-length.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp index b9b475f4b..ea235b2e4 100644 --- a/src/svg/svg-length.cpp +++ b/src/svg/svg-length.cpp @@ -520,7 +520,8 @@ gchar const *sp_svg_length_get_css_units(SVGLength::Unit unit) case SVGLength::MM: return "mm"; case SVGLength::CM: return "cm"; case SVGLength::INCH: return "in"; - case SVGLength::FOOT: return ""; // Does not have a "foot" unit string in the SVG spec + case SVGLength::FOOT: return ""; // Not in SVG/CSS specification. + case SVGLength::MITRE: return ""; // Not in SVG/CSS specification. case SVGLength::EM: return "em"; case SVGLength::EX: return "ex"; case SVGLength::PERCENT: return "%"; @@ -539,6 +540,8 @@ std::string sp_svg_length_write_with_units(SVGLength const &length) os << 100*length.value << sp_svg_length_get_css_units(length.unit); } else if (length.unit == SVGLength::FOOT) { os << 12*length.value << sp_svg_length_get_css_units(SVGLength::INCH); + } else if (length.unit == SVGLength::MITRE) { + os << 100*length.value << sp_svg_length_get_css_units(SVGLength::CM); } else { os << length.value << sp_svg_length_get_css_units(length.unit); } |
