[dia] svg: fix interpretation of units inch and pica



commit 1c47daee0c2002152e4a80b43ff65dbd0ea07aba
Author: Hans Breuer <hans breuer org>
Date:   Sun Aug 25 10:58:53 2013 +0200

    svg: fix interpretation of units inch and pica

 plug-ins/svg/svg-import.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/svg/svg-import.c b/plug-ins/svg/svg-import.c
index 10c9b72..d7c7235 100644
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -95,9 +95,11 @@ get_value_as_cm (const gchar *nptr,
     else if (strncmp(endp, "mm", 2) == 0)
         val /= 10.0, endp+=2;
     else if (strncmp(endp, "in", 2) == 0)
-        val /= 2.54, endp+=2;
+        val *= 2.54, endp+=2;
     else if (strncmp(endp, "pt", 2) == 0)
-        val *= 0.03528, endp+=2;
+        val *= (2.54/72.0), endp+=2;
+    else if (strncmp(endp, "pc", 2) == 0)
+        val *= (2.54/6.0), endp+=2;
     /* the rest can't really be resolved here, passing unit to caller (who will just ignore at the moment) */
     
     if (endptr)


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