You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
Stroke dash array attribute is different in raphael.js from normal svg.
In raphael js it is one of the following array [“”, “-”, “.”, “-.”, “-..”, “. ”, “- ”, “--”, “- .”, “--.”, “--..”] . But in normal svg it is a list of comma and/or white space separated s and s that specify the lengths of alternating dashes and gaps.
so if we export svg it will not be correct in stroke dash array.
I suggest add the following case in switch present in 'tag' function (after line 102)
case 'stroke-dasharray':
var sw = attrs['stroke-width'] !== undefined ? attrs['stroke-width'] : 1 ;
switch(element){
case "" :
element = "0";
break;
case "-" :
element = (3_sw)+","+sw;
break;
case "." :
element = sw+","+sw;
break;
case "-." :
element = (3_sw)+","+sw+","+sw+","+sw;
break;
case "-.." :
element = (3_sw)+","+sw+","+sw+","+sw+","+sw+","+sw;
break;
case ". " :
element = sw+","+(3_sw);
break;
case "- " :
element = (4_sw)+","+(3_sw);
break;
case "--" :
element = (8_sw)+","+(3_sw);
break;
case "- ." :
element = (4_sw)+","+(3_sw)+","+sw+","+(3_sw);
break;
case "--." :
element = (8_sw)+","+(3_sw)+","+sw+","+(3_sw);
break;
case "--.." :
element = (8_sw)+","+(3_sw)+","+sw+","+(3_sw)+","+sw+","+(3_sw);
break;
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Stroke dash array attribute is different in raphael.js from normal svg.
In raphael js it is one of the following array [“”, “-”, “.”, “-.”, “-..”, “. ”, “- ”, “--”, “- .”, “--.”, “--..”] . But in normal svg it is a list of comma and/or white space separated s and s that specify the lengths of alternating dashes and gaps.
Refer : http://raphaeljs.com/reference.html#Element.attr
and https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
so if we export svg it will not be correct in stroke dash array.
I suggest add the following case in switch present in 'tag' function (after line 102)
case 'stroke-dasharray':
var sw = attrs['stroke-width'] !== undefined ? attrs['stroke-width'] : 1 ;
switch(element){
case "" :
element = "0";
break;
case "-" :
element = (3_sw)+","+sw;
break;
case "." :
element = sw+","+sw;
break;
case "-." :
element = (3_sw)+","+sw+","+sw+","+sw;
break;
case "-.." :
element = (3_sw)+","+sw+","+sw+","+sw+","+sw+","+sw;
break;
case ". " :
element = sw+","+(3_sw);
break;
case "- " :
element = (4_sw)+","+(3_sw);
break;
case "--" :
element = (8_sw)+","+(3_sw);
break;
case "- ." :
element = (4_sw)+","+(3_sw)+","+sw+","+(3_sw);
break;
case "--." :
element = (8_sw)+","+(3_sw)+","+sw+","+(3_sw);
break;
case "--.." :
element = (8_sw)+","+(3_sw)+","+sw+","+(3_sw)+","+sw+","+(3_sw);
break;
}
The text was updated successfully, but these errors were encountered: