Skip to content

Commit 28ea478

Browse files
committed
startSVGElementHandler: Improved handling of use tags in the absence of defs tags.
1 parent a558b09 commit 28ea478

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/rbpdf.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18071,9 +18071,9 @@ def startSVGElementHandler(name, attribs, clipping = false)
1807118071
@svgclippaths[@svgclipid] << {'name' => name, 'attribs' => attribs}
1807218072
return
1807318073
end
18074-
if @svgdefsmode && !['clipPath', 'linearGradient', 'radialGradient', 'stop'].include?(name)
18074+
unless ['clipPath', 'linearGradient', 'radialGradient', 'stop'].include?(name)
1807518075
@svgdefs[attribs['id']] = {'name' => name, 'attribs' => attribs}
18076-
return
18076+
return if @svgdefsmode
1807718077
end
1807818078

1807918079
prev_svgstyle = @svgstyles[@svgstyles.size - 1] # previous style
@@ -18362,8 +18362,8 @@ def startSVGElementHandler(name, attribs, clipping = false)
1836218362
if attribs['xlink:href']
1836318363
attribs.delete('xlink:href')
1836418364
end
18365-
if attribs['id']
18366-
attribs.delete('id')
18365+
if use['id']
18366+
use.delete('id')
1836718367
end
1836818368
attribs = use['attribs'].merge(attribs)
1836918369
startSVGElementHandler(use['name'], use['attribs'])

0 commit comments

Comments
 (0)