Arrows in SVG aren't rotated when rendered by browsers

I created an SVG file, and in inkscape it looks like this:

在这里输入图像描述

But when I render it by a browser, the arrows get screwed up:

This (above) is the actual svg (link), and in case it renders correctly in your browser, here is how I see it (this time it's a screenshot in png):

在这里输入图像描述

It's the same in the latest Firefox and Chrome.

This file was created in inkscape 0.48 on Windows, and when I re-open it in inkscape, it renders correctly. Is there a way to make the browser rotate the arrows?


There are bug reports of this for Chrome, Firefox, Inkscape, and Wikimedia. It turns out that some renderers get the arrow direction wrong when just one handle, the one at the beginning of the curve, has zero length. Currently, Firefox, Inkscape, and LibreOffice Write get it right, while Chrome gets it wrong.

To create an example of such a line, draw a line in Inkscape, then add a curved midpoint. Inkscape then makes both segments Bezier curves, but the end segments have zero length handles. If you then delete the midpoint, Inkscape will try to match the curve, and will create non-zero length handles for the endpoints.

Reported as bug in Firefox in 2015, and fixed

Reported as bug in Chrome in 2015, and not fixed

Reported as bug in Inkscape in 2006, blamed on user and closed as "out of date" in 2009

Reported as bug in Wikimedia in 2015, by me

Discussion of ambiguity in SVG spec


我在Inkscape中注意到的一个修复方法是首先选择“按节点编辑路径”选项,然后选择每个端点并从路径编辑工具栏中选择“使所选节点平滑”的选项。


I found the solution:

The problem was that for these lines Bezier curves were used, and even though the lines were straight, it caused the problem. Once I replaced the curves with "diagram connectors", the problem disappeared.

链接地址: http://www.djcxy.com/p/56950.html

上一篇: Chrome / Firefox之间不一致的SVG渲染

下一篇: 浏览器渲染时,SVG中的箭头不会旋转