From 772eb991389fc1b8bdbf7cabb4ecde1be3243e3c Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sat, 14 Mar 2015 13:02:49 +0100 Subject: Partial fix for bug 1430873. Rectangles should behave properly with % values. (bzr r14004) --- src/xml/repr-util.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/xml/repr-util.cpp') diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 12280ea5a..7c5d2d6fc 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -32,6 +32,7 @@ #include <2geom/point.h> #include "svg/stringstream.h" #include "svg/css-ostringstream.h" +#include "svg/svg-length.h" #include "xml/repr.h" #include "xml/repr-sorting.h" @@ -502,6 +503,20 @@ unsigned int sp_repr_set_svg_double(Inkscape::XML::Node *repr, gchar const *key, return true; } +/** + * For attributes where an exponent is allowed. + * + * Not suitable for property attributes. + */ +unsigned int sp_repr_set_svg_length(Inkscape::XML::Node *repr, gchar const *key, SVGLength &val) +{ + g_return_val_if_fail(repr != NULL, FALSE); + g_return_val_if_fail(key != NULL, FALSE); + + repr->setAttribute(key, val.write()); + return true; +} + unsigned sp_repr_set_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point const & val) { g_return_val_if_fail(repr != NULL, FALSE); -- cgit v1.2.3