我在另一个 SVG 中有一个 SVG,但是内部的 SVG 正在剪裁。
如果我检查元素,检查器会显示正确大小的矩形:
我一直在尝试更改内部 SVG 上的 viewBox,但没有任何乐趣。有没有正确显示它的技术?
.canvas{
background: #000000;
}
<svg width="136" height="200" viewBox="0 0 136 200" class="canvas">
<g id="grid">
<line x1="16" x2="112" y1="16" y2="16" stroke="rgba(255,255,255,0.3)"></line>
<line x1="16" x2="16" y1="16" y2="176" stroke="rgba(255,255,255,0.3)"></line>
<line x1="48" x2="48" y1="16" y2="176" stroke="rgba(255,255,255,0.3)"></line>
<line x1="80" x2="80" y1="16" y2="176" stroke="rgba(255,255,255,0.3)"></line>
<line x1="112" x2="112" y1="16" y2="176" stroke="rgba(255,255,255,0.3)"></line>
<line x1="16" x2="112" y1="48" y2="48" stroke="rgba(255,255,255,0.3)"></line>
<line x1="16" x2="112" y1="80" y2="80" stroke="rgba(255,255,255,0.3)"></line>
<line x1="16" x2="112" y1="112" y2="112" stroke="rgba(255,255,255,0.3)"></line>
<line x1="16" x2="112" y1="144" y2="144" stroke="rgba(255,255,255,0.3)"></line>
<line x1="16" x2="112" y1="176" y2="176" stroke="rgba(255,255,255,0.3)"></line>
</g>
<g id="items">
<svg width="32" height="32" x="32" y="64" style="transform: rotate(90deg);">
<g>
<g>
<rect x="20" y="20" width="24" height="24" fill="#683C34" class=""></rect>
</g>
<g>
<rect x="20" y="28" width="24" height="4" fill="#F4B03C" class=""></rect>
</g>
<g>
<rect x="24" y="20" width="4" height="12" fill="#F4B03C" class=""></rect>
</g>
<g>
<rect x="36" y="20" width="4" height="8" fill="#F4B03C" class=""></rect>
</g>
<g>
<rect x="20" y="32" width="24" height="4" fill="#FFDA70" class=""></rect>
</g>
<g>
<rect x="24" y="36" width="4" height="8" fill="#FFDA70" class=""></rect>
</g>
<g>
<rect x="36" y="36" width="4" height="8" fill="#FFDA70" class=""></rect>
</g>
</g>
</svg>
</g>
</svg>