1
0
Fork 0

Canvas SVG: fix parsing of elliptical arcs in paths

See discussion in https://sourceforge.net/p/flightgear/codetickets/2569/ 

Colin Geniet found and fixed this, and has audited existing FGaddon
aircraft against this (also the FG1000).
This commit is contained in:
James Turner 2021-04-01 12:17:41 +01:00
parent 76192e2545
commit 02c70ee05f
3 changed files with 4 additions and 4 deletions

View file

@ -53,7 +53,7 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
d="m 38,58 l 0,-38 a 10,10 0 1 1 -20,0 l -5,-7 m5,7 l 8,-2"
d="m 38,58 l 0,-38 a 10,10 0 1 0 -20,0 l -5,-7 m5,7 l 8,-2"
id="path7043"
style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:55.40000153;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"/>
</g>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -54,7 +54,7 @@
inkscape:groupmode="layer"
transform="matrix(-1,0,0,1,59,0)">
<path
d="m 38,58 0,-38 a 10,10 0 1 1 -20,0 l -5,-7 m 5,7 8,-2"
d="m 38,58 0,-38 a 10,10 0 1 0 -20,0 l -5,-7 m 5,7 8,-2"
id="path7043"
style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:55.40000153;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
inkscape:connector-curvature="0" />

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -262,9 +262,9 @@ var parsesvg = func(group, path, options = nil)
# SVG: (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
# OpenVG: rh,rv,rot,x0,y0
if( args[i + 3] )
var cmd_vg = args[i + 4] ? Path.VG_LCCWARC_TO : Path.VG_LCWARC_TO;
var cmd_vg = args[i + 4] ? Path.VG_LCWARC_TO : Path.VG_LCCWARC_TO;
else
var cmd_vg = args[i + 4] ? Path.VG_SCCWARC_TO : Path.VG_SCWARC_TO;
var cmd_vg = args[i + 4] ? Path.VG_SCWARC_TO : Path.VG_SCCWARC_TO;
append(cmds, rel ? cmd_vg + 1: cmd_vg);
append(coords, args[i],
args[i + 1],