diff options
-rw-r--r-- | svgbob/src/buffer/cell_buffer.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/svgbob/src/buffer/cell_buffer.rs b/svgbob/src/buffer/cell_buffer.rs index f50c1e9..4383cfc 100644 --- a/svgbob/src/buffer/cell_buffer.rs +++ b/svgbob/src/buffer/cell_buffer.rs @@ -311,8 +311,10 @@ impl CellBuffer { if settings.include_defs { children.push(Self::get_defs()); } - children.extend(fragment_nodes); + // backdrop needs to appear first before the fragment nodes + // otherwise it will cover the other elements + // in accordance to how z-index works if settings.include_backdrop { children.push(rect( vec![class("backdrop"), x(0), y(0), width(w), height(h)], @@ -320,6 +322,8 @@ impl CellBuffer { )); } + children.extend(fragment_nodes); + svg( vec![xmlns("http://www.w3.org/2000/svg"), width(w), height(h)], children, |