Painter: Fixed problems with style and path (thanks zouql)

This commit is contained in:
Mirek Fidler 2025-09-23 16:44:08 +02:00
parent bb95965801
commit de1da82e5c
5 changed files with 349 additions and 15 deletions

View file

@ -10,6 +10,7 @@ uses
file
main.cpp,
SVG readonly separator,
svg\biplane.svg,
svg\altum_angelfish_01.svg,
svg\brown_fish_01.svg,
svg\matrix.svg,

View file

@ -121,7 +121,7 @@ SvgView::SvgView()
Sizeable().Zoomable();
AddFrame(splitter.Left(files, 200));
AddFrame(splitter.Left(files, DPI(200)));
dir = GetDataFile("svg");
}

View file

@ -0,0 +1,298 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="941.66"
height="843.39"
viewBox="0 0 941.66 843.39"
version="1.1"
id="svg19"
sodipodi:docname="free-download-laser-cut-biplane-airplane-plans.svg"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<title
id="title19">Free 3D Biplane Model SVG Files for Laser Cutting</title>
<sodipodi:namedview
id="namedview19"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="0.9283961"
inkscape:cx="471.24282"
inkscape:cy="421.69501"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg19" />
<defs
id="defs1">
<style
id="style1">
.cls-1 {
fill: none;
stroke: #000;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 1.25px;
}
.cls-2 {
font-family: TimesNewRomanPSMT, 'Times New Roman';
font-size: 22.5px;
}
</style>
</defs>
<g
id="_0"
data-name="0">
<g
id="TEXT">
<text
class="cls-2"
transform="translate(386.83 811.66)"
id="text1"><tspan
x="0"
y="0"
id="tspan1">templatesarea.com</tspan></text>
</g>
</g>
<g
id="templatesarea.com">
<g
id="CIRCLE">
<circle
class="cls-1"
cx="828.7"
cy="515.76"
r="15.07"
id="circle1" />
</g>
<g
id="CIRCLE-2"
data-name="CIRCLE">
<circle
class="cls-1"
cx="828.7"
cy="515.76"
r="36.85"
id="circle2" />
</g>
<g
id="SPLINE">
<path
class="cls-1"
d="M789.05,52.8c3.58,8,9.08,15.91,16.86,20.82,10.22,6.45,24.39,7.71,36.57,5.13s23.28-9.58,30.24-19.41c4.89-6.91,8.01-15.27,10.49-23.58,1.05-3.54,1.99-7.06,2.93-10.58h8.5v36.19h18.95c0,23.38,0,46.76,0,70.14,0,6.64-4.7,11.34-11.34,11.34h-7.62v-51.84h-8.5v51.84h-100.09v-43.89h-8.5v43.89h-39.67c-4.35-.02-8.71-.04-13.05-.38-8.79-.69-17.55-2.69-25.76-5.94-12.12-4.8-23.07-12.33-32.73-21.19-9.03-8.28-16.93-17.73-21.67-29.3-2.52-6.16-4.15-12.92-2.58-19.33,1.12-4.59,3.87-8.99,7.83-11.44,1.75-1.08,3.73-1.79,5.97-2.21.87-.16,1.75-.25,2.63-.25,43.52,0,87.04,0,130.56,0"
id="path2" />
</g>
<g
id="SPLINE-2"
data-name="SPLINE">
<path
class="cls-1"
d="M339.16,204.88v60.99c-62.35-13.29-124.71-26.57-187.06-39.86-1.11,3.81-2.23,7.61-3.46,11.37-5.61,17.24-13.37,33.56-23.09,49.38-5.33,8.68-11.25,17.2-19.71,22.49-11.94,7.47-28.94,8.49-42.16,2.87-10.9-4.63-19.23-13.78-25.17-24.09-7.21-12.53-10.88-26.8-10.41-41.03.3-9.18,2.33-18.35,6.41-26.54,2.47-4.96,5.69-9.56,9.52-13.52.11-.11.22-.23.33-.34,3.46-3.51,3.46-8.44,0-11.94-.11-.11-.22-.23-.33-.34-3.83-3.96-7.05-8.56-9.52-13.52-4.08-8.19-6.1-17.36-6.41-26.54-.47-14.23,3.2-28.5,10.41-41.03,5.94-10.31,14.27-19.46,25.17-24.09,13.22-5.62,30.22-4.61,42.16,2.87,8.45,5.29,14.37,13.81,19.71,22.49,9.72,15.82,17.47,32.14,23.09,49.38,1.22,3.76,2.35,7.56,3.46,11.37l187.06-39.86v60.99h-146.88v8.5h146.88Z"
id="path3" />
</g>
<g
id="CIRCLE-3"
data-name="CIRCLE">
<circle
class="cls-1"
cx="177.08"
cy="55.98"
r="15.75"
id="circle3" />
</g>
<g
id="SPLINE-3"
data-name="SPLINE">
<path
class="cls-1"
d="M201.31,70.58c2.45-4.06,6.74-6.07,11.43-5.36,5.05.77,10.11,1.56,15.17,2.38,13.64,2.21,27.37,4.67,40.85,6.51,11.18,1.52,22.2,2.61,34.25,1.08,6.6-.84,13.51-2.46,17.74-6.99,2.15-2.3,3.6-5.35,4.25-8.59.24-1.2.37-2.43.36-3.63,0-1.2-.12-2.43-.36-3.63-.65-3.24-2.11-6.29-4.25-8.59-4.23-4.53-11.14-6.16-17.74-6.99-12.05-1.53-23.07-.44-34.25,1.08-13.48,1.83-27.21,4.29-40.85,6.51-5.07.82-10.12,1.61-15.17,2.38-4.69.72-8.98-1.3-11.43-5.36-5.24-8.7-14.08-13.69-24.23-13.69s-18.99,4.99-24.23,13.69c-2.45,4.06-6.74,6.07-11.43,5.36-5.05-.77-10.11-1.56-15.17-2.38-13.64-2.21-27.37-4.67-40.85-6.51-11.18-1.52-22.2-2.61-34.25-1.08-6.6.84-13.51,2.46-17.74,6.99-2.15,2.3-3.6,5.35-4.25,8.59-.24,1.2-.37,2.43-.36,3.63,0,1.2.12,2.43.36,3.63.65,3.24,2.11,6.29,4.25,8.59,4.23,4.53,11.14,6.16,17.74,6.99,12.05,1.53,23.07.44,34.25-1.08,13.48-1.83,27.21-4.29,40.85-6.51,5.07-.82,10.12-1.61,15.17-2.38,4.69-.72,8.98,1.3,11.43,5.36,5.24,8.7,14.08,13.69,24.23,13.69s18.99-4.99,24.23-13.69Z"
id="path4" />
</g>
<g
id="LWPOLYLINE">
<path
class="cls-1"
d="M555.66,183.38v-1.66c0-4.7,3.81-8.5,8.5-8.5h16.12l2.48-6.32h16.6c9.39,0,17.01,7.61,17.01,17.01v24.68l51.45,46.25c18.79-10.67,41.8-10.67,60.58,0l51.45-46.25v-24.68c0-9.39,7.61-17.01,17.01-17.01h16.6l2.48,6.32h16.12c4.7,0,8.5,3.81,8.5,8.5v1.66h-15.55v8.5h15.55v1.66c0,4.7-3.81,8.5-8.5,8.5h-16.12l-2.48,6.32-5.26.04-48.5,61.65c5.6,26.04,8.69,52.55,9.24,79.18-4.82,6.79-10.73,12.73-17.5,17.57v-46.49h-8.5v29.9h-40.57v-29.9h-8.5v29.9h-40.57s0-29.9,0-29.9h-8.5v46.49c-6.77-4.85-12.68-10.79-17.5-17.57.55-26.63,3.64-53.14,9.24-79.18l-48.5-61.65-5.26-.04-2.48-6.32h-16.12c-4.7,0-8.5-3.81-8.5-8.5v-1.66h15.55v-8.5h-15.55Z"
id="path5" />
</g>
<g
id="LWPOLYLINE-2"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M884.39,239.56v8.5h13.64v1.66c0,4.7,3.81,8.5,8.5,8.5h7.05v12.33c-18.47.87-36.26-7.04-47.98-21.35-2.57-3.13-2.57-7.64,0-10.78,11.72-14.3,29.51-22.22,47.98-21.35v12.33s-7.05,0-7.05,0c-4.7,0-8.5,3.81-8.5,8.5v1.66h-13.64Z"
id="path6" />
</g>
<g
id="LWPOLYLINE-3"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M862.35,353.71v8.5h-19.55c.23.4.49.78.79,1.14,11.71,14.3,29.49,22.21,47.95,21.35v-12.33h22.05v-10.16h-22.05v-8.5h22.05v-10.16h-22.05v-12.33c-18.46-.86-36.24,7.05-47.95,21.35-.29.36-.56.74-.79,1.14h19.55Z"
id="path7" />
</g>
<g
id="LWPOLYLINE-4"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M809.56,265.18c-15.69,0-28.41,12.72-28.41,28.41,0,15.69,12.72,28.41,28.41,28.41.64,6.27,3.69,12.04,8.51,16.09h18.04v-40.24h-18.47v-8.5h18.47v-40.24h-18.04c-4.82,4.05-7.88,9.82-8.51,16.09Z"
id="path8" />
</g>
<g
id="SPLINE-4"
data-name="SPLINE">
<path
class="cls-1"
d="M885.76,188.97v-15.55h1.66c4.98,0,8.5,3.52,8.5,8.5v7.05l6.06,1.21v6.24c0,7.07-8.48,12.06-20.47,12.06-11.99,0-20.47-5-20.47-12.06v-6.24l6.06-1.21v-7.05c0-4.98,3.52-8.5,8.5-8.5h1.66v15.55h8.5Z"
id="path9" />
</g>
<g
id="SPLINE-5"
data-name="SPLINE">
<path
class="cls-1"
d="M382.35,234.16h-8.5v-65.83c-1.86.92-3.64,1.84-5.27,2.97-4.56,3.16-8,7.97-10.37,13.1-5.56,12.01-5.26,25.74-3.94,38.97,1.22,12.16,3.31,23.9,6.59,35.4,2.07,7.28,4.62,14.47,7.43,21.54,1.76,4.41,3.61,8.78,5.78,14.23h48.86v-45.73h8.5v45.73h48.86c2.16-5.46,4.02-9.82,5.78-14.23,2.81-7.06,5.36-14.26,7.43-21.54,3.28-11.51,5.37-23.24,6.59-35.4,1.33-13.23,1.62-26.96-3.94-38.97-2.37-5.12-5.81-9.93-10.37-13.1-1.63-1.13-3.41-2.05-5.27-2.97v65.83h-8.5v-65.83c-28.79-14.31-60.86-14.31-89.65,0v65.83Z"
id="path10" />
</g>
<g
id="LWPOLYLINE-5"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M605.66,782.92c38.47-.62,69.15-32.3,68.53-70.77-.61-37.59-30.93-67.92-68.52-68.53h-30.01v73.17h-8.5v-73.17l-88.32.02c-37.8.66-68.58,30.58-70.31,68.35h-3.69v-29.17h-106.66v29.17h-3.69c-1.73-37.77-32.51-67.69-70.31-68.35l-88.32-.02v73.17h-8.5v-73.17h-30.01c-38.47.62-69.14,32.31-68.52,70.77.61,37.59,30.94,67.92,68.53,68.52h249.9v-58.64h8.5v58.64h249.9Z"
id="path11" />
</g>
<g
id="LWPOLYLINE-6"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M352.35,540.33c26-.03,47.78-19.7,50.44-45.57l165.2-16.61v69.59h8.5v-70.45l23.85-2.4c3.69-.37,7.41-.4,11.11-.08,26.21,2.23,49,18.89,59.06,43.2,14.88,35.92-2.18,77.1-38.1,91.97-5.42,2.25-11.15,3.69-16.99,4.27l-263.09,26.45-263.09-26.45c-5.84-.59-11.56-2.03-16.99-4.27-24.31-10.07-40.97-32.85-43.2-59.06-3.3-38.74,25.43-72.81,64.17-76.11,3.7-.31,7.42-.29,11.11.08l23.85,2.4v70.45h8.5v-69.59l165.2,16.61c2.66,25.87,24.44,45.54,50.44,45.57Z"
id="path12" />
</g>
<g
id="SPLINE-6"
data-name="SPLINE">
<path
class="cls-1"
d="M318.2,401.9v-.16"
id="path13" />
</g>
<g
id="SPLINE-7"
data-name="SPLINE">
<path
class="cls-1"
d="M465.08,342.74v8.5h145.46c-14.14,24.62-38.39,39.37-66.75,40.6.82,2.83,1.65,5.67,2.47,8.5,9.01-1.32,16.91,3.22,20.31,11.68s.85,17.19-6.56,22.49-16.51,4.87-23.4-1.09c-6.89-5.96-8.62-14.9-4.45-23-5.14-3.88-10.29-7.77-15.43-11.65-40.93,17.52-84,28.82-128.25,33.66-4.09.45-8.2.67-12.32.67h-106.47v8.5h48.53v.16c0,11.62-8.22,19.84-19.84,19.84h-87.33c0-24.15,0-48.29,0-72.44h-8.5v72.44h-18.27c-6.64,0-11.34-4.7-11.34-11.34v-1.61h-22.51c-1.97,0-3.93-.14-5.87-.41-42.31-5.9-75.76-32.47-91.09-72.34l-16.12.02c-2.29,0-4.4-.87-6.02-2.48s-2.49-3.73-2.5-6.01v-1.66c5.18,0,10.37-.01,15.55-.02v-8.5c-5.19,0-10.38.01-15.56.02v-1.66c0-4.98,3.51-8.51,8.49-8.51l16.12-.02c4.64-9.43,13.24-15.48,23.69-16.66,39.56,0,79.12-.02,118.67-.03l-2.35,16.71,8.42,1.18,2.52-17.9h6.31c7.13,15,14.26,30,21.39,45.01,26.35,0,52.7,0,79.05,0v20.47h8.5v-88.52c52.49,3.77,104.98,7.53,157.47,11.3,5.8-4.46,11.59-8.92,16.19-14.36,5.35-6.33,9.08-13.98,12.59-21.82,3.71-8.29,7.18-16.8,13.4-23.02,8.78-8.78,23.05-12.98,35.83-11.5,15.35,1.78,28.55,11.76,38.35,23.89,7.74,9.58,13.36,20.49,15.54,32.11,1.09,5.81,1.32,11.8,1.55,17.79,0,7,0,14.01,0,21.01h-145.46Z"
id="path14" />
</g>
<g
id="LWPOLYLINE-7"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M613.65,433.82v-1.21h70.44v-8.5h-70.44c2.07-17.04,16.73-29.72,33.88-29.32l102.15,20.61c3.29.66,6.12,2.75,7.72,5.7,2.99,5.5.96,12.39-4.54,15.38l-48.02,26.12,65.76,89.73,53.65,29.17c2.95,1.6,5.03,4.43,5.7,7.72,1.24,6.14-2.73,12.12-8.87,13.36l-102.15,20.61c-17.16.4-31.81-12.29-33.88-29.32h66.13v-8.5h-66.13v-1.21c0-4.09,2.91-7.6,6.92-8.36,12.27-2.38,24.02-6.92,34.7-13.4,5.46-3.36,7.16-10.5,3.8-15.96-.14-.23-.3-.46-.46-.69l-48.03-65.52c-15.04-19.86-36.92-33.42-61.39-38.04-4.02-.76-6.92-4.27-6.92-8.36Z"
id="path15" />
</g>
<g
id="SPLINE-8"
data-name="SPLINE">
<path
class="cls-1"
d="M500.14,52.8c3.58,8,9.08,15.91,16.86,20.82,10.22,6.45,24.39,7.71,36.57,5.13s23.28-9.58,30.24-19.41c4.89-6.91,8.01-15.27,10.49-23.58,1.05-3.54,1.99-7.06,2.93-10.58h8.5v36.19h18.95c0,23.38,0,46.76,0,70.14,0,6.64-4.7,11.34-11.34,11.34h-7.62v-51.84h-8.5v51.84h-100.09v-43.89h-8.5v43.89h-39.67c-4.35-.02-8.71-.04-13.05-.38-8.79-.69-17.55-2.69-25.76-5.94-12.12-4.8-23.07-12.33-32.73-21.19-9.03-8.28-16.93-17.73-21.67-29.3-2.52-6.16-4.15-12.92-2.58-19.33,1.12-4.59,3.87-8.99,7.83-11.44,1.75-1.08,3.73-1.79,5.97-2.21.87-.16,1.75-.25,2.63-.25,43.52,0,87.04,0,130.56,0"
id="path16" />
</g>
<g
id="LWPOLYLINE-8"
data-name="LWPOLYLINE">
<path
class="cls-1"
d="M720.98,781.21h-1.21v-70.44h-8.5v70.44c-17.04-2.07-29.72-16.73-29.32-33.88l20.61-102.15c.66-3.29,2.75-6.12,5.7-7.72,5.5-2.99,12.39-.96,15.38,4.54l26.12,48.02,89.73-65.76,29.17-53.65c1.6-2.95,4.43-5.03,7.72-5.7,6.14-1.24,12.12,2.73,13.36,8.87l20.61,102.15c.4,17.16-12.29,31.81-29.32,33.88v-66.13h-8.5v66.13h-1.21c-4.09,0-7.6-2.91-8.36-6.92-2.38-12.27-6.92-24.02-13.4-34.7-3.36-5.46-10.5-7.16-15.96-3.8-.23.14-.46.3-.69.46l-65.52,48.03c-19.86,15.04-33.42,36.92-38.04,61.39-.76,4.02-4.27,6.92-8.36,6.92Z"
id="path17" />
</g>
<g
id="SPLINE-9"
data-name="SPLINE">
<path
class="cls-1"
d="M887.81,298.3v-15.55h1.66c4.98,0,8.5,3.52,8.5,8.5v7.05l6.06,1.21v6.24c0,7.07-8.48,12.06-20.47,12.06-11.99,0-20.47-5-20.47-12.06v-6.24l6.06-1.21v-7.05c0-4.98,3.52-8.5,8.5-8.5h1.66v15.55h8.5Z"
id="path18" />
</g>
<g
id="CIRCLE-4"
data-name="CIRCLE">
<circle
class="cls-1"
cx="830.02"
cy="420.99"
r="15.07"
id="circle18" />
</g>
<g
id="CIRCLE-5"
data-name="CIRCLE">
<circle
class="cls-1"
cx="830.02"
cy="420.99"
r="36.85"
id="circle19" />
</g>
</g>
<metadata
id="metadata19">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-nc/4.0/" />
<dc:title>Free 3D Biplane Model SVG Files for Laser Cutting</dc:title>
<dc:description>Get your free laser-cut SVG files for crafting an impressive wooden plane.</dc:description>
<dc:creator>
<cc:Agent>
<dc:title>templatesarea.com</dc:title>
</cc:Agent>
</dc:creator>
<dc:publisher>
<cc:Agent>
<dc:title>templatesarea.com</dc:title>
</cc:Agent>
</dc:publisher>
<dc:rights>
<cc:Agent>
<dc:title>https://www.templatesarea.com/license-agreement/</dc:title>
</cc:Agent>
</dc:rights>
<dc:date>2025.03.17</dc:date>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-nc/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:prohibits
rdf:resource="http://creativecommons.org/ns#CommercialUse" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -6,7 +6,9 @@ Painter& Painter::Path(CParser& p)
{
Pointf current(0, 0);
bool done = false;
int previousCmd = 0;
while(!p.IsEof()) {
while(p.Char(','));
int c = p.GetChar();
p.Spaces();
bool rel = IsLower(c);
@ -23,13 +25,14 @@ Painter& Painter::Path(CParser& p)
t += current;
return t;
};
auto ReadPoint = [&]() { return ReadPointP(current, rel); };
auto ReadPoint = [&] { return ReadPointP(current, rel); };
auto IsDouble = [&] { while(p.Char(',')) {} return p.IsDouble2(); };
switch(ToUpper(c)) {
case 'M':
current = ReadPoint();
Move(current);
case 'L':
while(p.IsDouble2()) {
while(IsDouble()) {
current = ReadPoint();
Line(current);
}
@ -40,21 +43,21 @@ Painter& Painter::Path(CParser& p)
done = true;
break;
case 'H':
while(p.IsDouble2()) {
while(IsDouble()) {
current.x = p.ReadDouble() + rel * current.x;
Line(current);
done = true;
}
break;
case 'V':
while(p.IsDouble2()) {
while(IsDouble()) {
current.y = p.ReadDouble() + rel * current.y;
Line(current);
done = true;
}
break;
case 'C':
while(p.IsDouble2()) {
while(IsDouble()) {
t1 = ReadPoint();
t2 = ReadPoint();
current = ReadPoint();
@ -63,15 +66,20 @@ Painter& Painter::Path(CParser& p)
}
break;
case 'S':
while(p.IsDouble2()) {
while(IsDouble()) {
Pointf now = current;
t2 = ReadPoint();
current = ReadPoint();
Cubic(t2, current);
if(previousCmd != 'C' && previousCmd != 'S')
Cubic(now, t2, current);
else
Cubic(t2, current);
while(p.Char(','));
done = true;
}
break;
case 'Q':
while(p.IsDouble2()) {
while(IsDouble()) {
t1 = ReadPoint();
current = ReadPoint();
Quadratic(t1, current);
@ -79,14 +87,18 @@ Painter& Painter::Path(CParser& p)
}
break;
case 'T':
while(p.IsDouble2()) {
while(IsDouble()) {
Pointf now = current;
current = ReadPoint();
Quadratic(current);
if(previousCmd != 'Q' && previousCmd != 'T')
Quadratic(now, current);
else
Quadratic(current);
done = true;
}
break;
case 'A':
while(p.IsDouble2()) {
while(IsDouble()) {
t1 = ReadPointP(Pointf(0, 0), false);
double xangle = ReadDouble();
auto ReadBool = [&] {
@ -107,6 +119,8 @@ Painter& Painter::Path(CParser& p)
Move(0, 0); // to clear previous path
return *this;
}
previousCmd = ToUpper(c);
}
if(!done)
Move(0, 0); // to clear previous path

View file

@ -84,7 +84,7 @@ void SvgParser::DoGradient(int gi, bool stroke)
r = r / sz;
}
Xform2D m;
if(g.radial) {
m.x.x = r.x;
m.x.y = 0;
@ -356,6 +356,27 @@ void SvgParser::Element(const XmlNode& n, int depth, bool dosymbols)
else
if(m.IsTag("radialGradient"))
ParseGradient(m, true);
else if(m.IsTag("style")) {
String text = m.GatherText();
try {
CParser p(text);
while(!p.IsEof()) {
if(p.Char('.') && p.IsId()) {
String id = p.ReadIdh();
if(p.Char('{')) {
const char *b = p.GetPtr();
while(!p.IsChar('}') && !p.IsEof())
p.SkipTerm();
classes.Add(id, String(b, p.GetPtr()));
}
p.Char('}');
}
else
p.SkipTerm();
}
}
catch(CParser::Error) {}
}
}
else
if(n.IsTag("linearGradient"))
@ -488,7 +509,7 @@ void SvgParser::Element(const XmlNode& n, int depth, bool dosymbols)
CParser p(text);
while(!p.IsEof()) {
if(p.Char('.') && p.IsId()) {
String id = p.ReadId();
String id = p.ReadIdh();
if(p.Char('{')) {
const char *b = p.GetPtr();
while(!p.IsChar('}') && !p.IsEof())
@ -633,4 +654,4 @@ Rectf GetSVGPathBoundingBox(const char *path)
return p.Get();
}
}
}