Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用toSVG()清除导出错误;_Javascript_Svg_Fabricjs - Fatal编程技术网

Javascript 使用toSVG()清除导出错误;

Javascript 使用toSVG()清除导出错误;,javascript,svg,fabricjs,Javascript,Svg,Fabricjs,我画了一个简单的正方形,然后toSVG()返回下一个代码: 使用Fabric.js 1.2.9创建 我将该代码保存为image.svg,并使用corel draw打开它,结果是: 结果不是正方形,有什么问题吗?问题是corel draw无法很好地解释代码,illustrator工作得很好。也许stroke dasharray缺少的值不知何故混淆了corel draw?没有,我给了属性一个值,我甚至试着移除它,结果是一样的。 <?xml version="1.0" standalone

我画了一个简单的正方形,然后toSVG()返回下一个代码:


使用Fabric.js 1.2.9创建
我将该代码保存为image.svg,并使用corel draw打开它,结果是:


结果不是正方形,有什么问题吗?

问题是corel draw无法很好地解释代码,illustrator工作得很好。

也许
stroke dasharray
缺少的值不知何故混淆了corel draw?没有,我给了属性一个值,我甚至试着移除它,结果是一样的。
<?xml version="1.0" standalone="no" ?><!DOCTYPE svg PUBLIC 
 "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" 
     xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" 
     width="800" height="266.6666666666667" 
     style="background-color: #FFFFFF" xml:space="preserve">
  <desc>Created with Fabric.js 1.2.9</desc>
  <defs></defs>
  <rect x="-30" y="-30" rx="0" ry="0" width="60" height="60" 
        style="stroke: #000000; stroke-width: 3; stroke-dasharray: ; 
               stroke-linecap: butt; stroke-linejoin: miter; 
               stroke-miterlimit: 10; fill: none; opacity: 1;" 
        transform="translate(400 133.33)"/>
</svg>