English 中文(简体)
SVGs与Raphael有奇怪的关系?
原标题:SVGs rendering strangely with Raphael?

我们有一个利用Raphael操纵SVGs的在线设计器。 我们重新准备一个大型的剪辑艺术图书馆,以用于这一目的,但这是一个非常奇怪的问题。

某些特殊群体正在陷入一个问题,他们在浏览器上课以罚款,但一旦他们被带入Raphael,他们就完全无法认识。

Here s an image showing the effect: enter image description here

www.un.org/spanish/ecosoc 这里还有Svg的代码(由1.ai文档中的一个显示器出口产生的):。

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     width="100px" height="83.641px" viewBox="0 0 100 83.641" enable-background="new 0 0 100 83.641" xml:space="preserve">
<polygon points="58.263,0.056 100,41.85 58.263,83.641 30.662,83.641 62.438,51.866 0,51.866 0,31.611 62.213,31.611 30.605,0 
    58.263,0.056 "/>
</svg>
最佳回答

预言,你将档案输入一条道路的过程可能会有缺陷,或者一些不记名的转变已经应用。 例如,这部法典有:

var paper = Raphael("paper");
paper.path(
    "M58.263,0.056 L100,41.85 L58.263,83.641 L30.662,83.641 " +
    "L62.438,51.866 L0,51.866 L0,31.611 L62.213,31.611 30.605,0"
).attr( {  fill :  black  } );

。 http://jsfiddle.net/sgMH6/

你们如何将这些档案翻译成拉法尔? 你们的程序/守则是什么?

Edit: more information; import plugin is https://github.com/wout/raphael-svg-import/blob/master/raphael-svg-import.js

看来,你重新使用的假想可能会有过错的多角执行常规。 这是一件hu事,但似乎只有0份没有正确处理。 缩略语

在职能<Raphael.fn.polygon上,有一节内容类似:

     var d = parseFloat(c[j]);
     if (d)
       poly.push(d);

如果你改变这一点,它可以为你工作:

    var d = parseFloat(c[j]);
    if (!d) d = 0;
    poly.push(d);

这是一种非常简陋的固定办法,可能打破其他东西。 无论如何,请看一个经过修改的原始固定结构――;如果这确实是一个骗局,请将其提交给原始作者。

问题回答

暂无回答




相关问题
How to simplify SVG code?

Is it possible to simplify / clean up svg code by replacing the use-tags with standard svg elements? Maybe an inkscape plugin? Haven t found anything... Background: I m converting some svgs to javafx ...

How to link from SVG?

What I tried is this <a xlink:target="http://ponyoverflow.com"> <text class="text" x="20" y="718" text-anchor="start">Mail Order Ponies</text> </a> and variations with href ...

Ruby Support for SVG

Is there some library or helper to produce SVG graphics with Ruby? I googled a bit and found many, but all seem to be dusty and very incomplete… Does anyone know about some nice, reliable alternative?

Mangling IDs and References to IDs in XML

I m trying to compose xml elements into each other, and the problem I am having is when there s the same IDs. Basically what I need to do is mangle all the IDs in an xml file, as well as the ...

热门标签