summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2020-11-04 13:11:55 +0800
committerJovansonlee Cesar <ivanceras@gmail.com>2020-11-04 13:11:55 +0800
commit146d1d5eb09e1d192a4a59b717bab82b2b204398 (patch)
treea9af62a9b576a09add1c477d1d1ea89e98f5519b
parentc3304e84fcf23d11e5c3287bd62127d9ece6a6be (diff)
Fix the order of backdrop and fragment nodes
-rw-r--r--svgbob/src/buffer/cell_buffer.rs6
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,