[dia] svg: consume transform="skew..."



commit 5eb2792d02e15004a390414c0bae975ba434929e
Author: Hans Breuer <hans breuer org>
Date:   Sun Jul 28 15:34:00 2013 +0200

    svg: consume transform="skew..."
    
    The offset calculation seems to be as incorrect as with
    the rotating matrix, otherwise seems to work.
    Tested with REC-SVG11-20110816/images/coords/Skew.svg

 lib/dia_svg.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index 3a587d3..e9179bd 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -1186,6 +1186,14 @@ dia_svg_parse_transform(const gchar *trans, real scale)
       m->x0 = g_ascii_strtod (list[i], NULL), ++i;
     if (list[i])
       m->y0 = g_ascii_strtod (list[i], NULL), ++i;
+  } else if (strncmp (trans, "skewX", 5) == 0) {
+    m->xx = m->yy = 1.0;
+    if (list[i])
+      m->yx = tan (G_PI*g_ascii_strtod (list[i], NULL)/180);
+  } else if (strncmp (trans, "skewY", 5) == 0) {
+    m->xx = m->yy = 1.0;
+    if (list[i])
+      m->xy = tan (G_PI*g_ascii_strtod (list[i], NULL)/180);
   } else {
     g_warning ("SVG: %s?", trans);
     g_free (m);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]