[dia] svg: improve stroke-dasharray import with odd number of values
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] svg: improve stroke-dasharray import with odd number of values
- Date: Wed, 1 Jan 2014 11:51:42 +0000 (UTC)
commit ab97346a112b7c90bdf549f616ba7f417e0281e5
Author: Hans Breuer <hans breuer org>
Date: Wed Jan 1 12:45:49 2014 +0100
svg: improve stroke-dasharray import with odd number of values
lib/dia_svg.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index 6766557..e7e51e3 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -456,10 +456,13 @@ _parse_dasharray (DiaSvgStyle *s, real user_scale, gchar *str, gchar **end)
case 4 :
s->linestyle = LINESTYLE_DASH_DOT;
break;
- case 6 : s->linestyle = LINESTYLE_DASH_DOT_DOT;
- break;
default :
- s->linestyle = LINESTYLE_DOTTED; /* not correct */
+ /* If an odd number of values is provided, then the list of values is repeated to
+ * yield an even number of values. Thus, stroke-dasharray: 5,3,2 is equivalent to
+ * stroke-dasharray: 5,3,2,5,3,2.
+ */
+ case 6 :
+ s->linestyle = LINESTYLE_DASH_DOT_DOT;
break;
}
g_strfreev (dashes);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]