summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 716597d)
raw | patch | inline | side by side (parent: 716597d)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 12 Jun 2008 20:38:23 +0000 (20:38 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 12 Jun 2008 20:38:23 +0000 (20:38 +0000) |
src/svg/svg-affine.cpp | patch | blob | history | |
src/svg/svg.h | patch | blob | history |
diff --git a/src/svg/svg-affine.cpp b/src/svg/svg-affine.cpp
index d339474475251b252222b7ec86eb29179cd0ac9a..0ad54accd66dfa2bc557500a282956d88ba2aea0 100644 (file)
--- a/src/svg/svg-affine.cpp
+++ b/src/svg/svg-affine.cpp
#include <libnr/nr-scale-matrix-ops.h>
#include <libnr/nr-translate-matrix-ops.h>
#include <libnr/nr-translate-rotate-ops.h>
+#include <libnr/nr-convert2geom.h>
#include "svg.h"
#include "prefs-utils.h"
# define M_PI 3.14159265358979323846
#endif
+bool
+sp_svg_transform_read(gchar const *str, Geom::Matrix *transform)
+{
+ NR::Matrix mat;
+ if (sp_svg_transform_read(str, &mat)) {
+ *transform = to_2geom(mat);
+ return true;
+ } else {
+ return false;
+ }
+}
+
bool
sp_svg_transform_read(gchar const *str, NR::Matrix *transform)
{
#define EQ(a,b) (fabs ((a) - (b)) < 1e-9)
+gchar *
+sp_svg_transform_write(Geom::Matrix const &transform)
+{
+ Geom::Matrix const t(transform);
+ return sp_svg_transform_write(&t);
+}
+
+
+gchar *
+sp_svg_transform_write(Geom::Matrix const *transform)
+{
+ NR::Matrix const t(from_2geom(*transform));
+ return sp_svg_transform_write(&t);
+}
+
gchar *
sp_svg_transform_write(NR::Matrix const &transform)
{
diff --git a/src/svg/svg.h b/src/svg/svg.h
index 0e5b4d5d5ee57df4b0ee30dfdbe1f31933f665c9..a273ceddca767d8bc6dde4777377c60a7fc5f57f 100644 (file)
--- a/src/svg/svg.h
+++ b/src/svg/svg.h
std::string sp_svg_length_write_with_units(SVGLength const &length);
+bool sp_svg_transform_read(gchar const *str, Geom::Matrix *transform);
bool sp_svg_transform_read(gchar const *str, NR::Matrix *transform);
+gchar *sp_svg_transform_write(Geom::Matrix const &transform);
+gchar *sp_svg_transform_write(Geom::Matrix const *transform);
gchar *sp_svg_transform_write(NR::Matrix const &transform);
gchar *sp_svg_transform_write(NR::Matrix const *transform);