# Rendering SVG transparent background

**URL:** <https://forum.juce.com/t/rendering-svg-transparent-background/69880>\
**Category:** General JUCE discussion\
**Created:** [November 10, 2026, 7:47pm UTC](https://forum.juce.com/t/rendering-svg-transparent-background/69880 "2026-11-10T19:47:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)\
**Post date:** [November 10, 2026, 7:47pm UTC](https://forum.juce.com/t/rendering-svg-transparent-background/69880/1 "2026-11-10T19:47:44Z")

</div>

Hi, I have a few animations in SVG format, these have an invisible background that allows a character to move within the invisible rectangle. But I can’t use the trick any more because Juce 9 ignores the transparent rectangle, I know it sounds the correct way to render something (don’t draw things you can’t see), but it breaks my animations.  
Is there a way of reenabling invisible shapes? Or do I just go back to using bitmaps?

anims[n]-\>drawWithin(g, re, RectanglePlacement::stretchToFit, 1.0f);

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [November 10, 2026, 8:16pm UTC](https://forum.juce.com/t/rendering-svg-transparent-background/69880/2 "2026-11-10T20:16:13Z")

</div>

using viewbox ?

See

> [@SVG renderer ignores the surrounding space](https://forum.juce.com/t/svg-renderer-ignores-the-surrounding-space/69429/9):
>
> Thanks for adding BoundsToEnclose to DrawableButton, that sorted out most of our icons when moving to 9.0.5. We switched our own code to contentBounds and it now lays out the same as it did on JUCE 8. One place we can’t reach is PreferencesPanel. It creates its tab buttons itself (juce\_PreferencesPanel.cpp:64), so they always fit the drawable bounds. Our tab icons have padding in their viewBox, and since that padding no longer counts they come out bigger than the rest of our icons. What would …
