SVG データにビュー ボックスの外側にあるピクセルがいくつかある場合、これらのピクセルも考慮した外接する四角形を取得するにはどうすればよいですか。
典型的な例は次のようなものです:
<svg id="L.T.S.P" width="100%" height="100%" viewBox="0 0 160 160" version="1.1" baseProfile="full" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>layer</title>
<desc>My Picture</desc>
<ellipse cx="80" cy="80" rx="60" ry="60" fill="none" stroke="rgb(139, 69, 19)" stroke-width="2"/>
<text x="80" y="102" text-anchor="middle" font-family="Arial" font-size="48pt" fill="rgb(139, 69, 19)" stroke="rgb(139, 69, 19)" stroke-width="0.25" style="direction: ltr; unicode-bidi: bidi-override;">T</text>
<g id="port" transform="matrix (1.22e-017, -0.2, 0.2, 1.22e-017, -20, 100)"><polygon points="60,**180** 140,180 160,200 160,40 140,20 60,20 40,40 40,200" fill="none" stroke="rgb(139, 69, 19)" stroke-width="10"/>
<polyline points="60,60 140,60" fill="none" stroke="rgb(139, 69, 19)" stroke-width="10" stroke-dasharray=""/>
<polyline points="60,100 140,100" fill="none" stroke="rgb(139, 69, 19)" stroke-width="10" stroke-dasharray=""/>
<polyline points="60,140 140,140" fill="none" stroke="rgb(139, 69, 19)" stroke-width="10" stroke-dasharray=""/>
<polyline points="100,20 100,0" fill="none" stroke="rgb(139, 69, 19)" stroke-width="10" stroke-dasharray=""/>
</g>
<g id="inputTemperature" transform="matrix (-0.2, -2.45e-017, 2.45e-017, -0.2, 180, 100)"><polyline points="0,100 200,100 80,40" fill="none" stroke="rgb(255, 0, 0)" stroke-width="10" stroke-dasharray=""/>
<polyline points="80,160 200,100" fill="none" stroke="rgb(255, 0, 0)" stroke-width="10" stroke-dasharray=""/>
</g>
</svg>