[librsvg] svg: cascade the tree when the Svg is loaded
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] svg: cascade the tree when the Svg is loaded
- Date: Sun, 13 Jan 2019 17:32:10 +0000 (UTC)
commit 68531efb3f90e853dafa0b925e56eacc5ad1e18a
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Jan 13 12:36:29 2019 +0100
svg: cascade the tree when the Svg is loaded
Instead of waiting for the first draw
rsvg_internals/src/handle.rs | 4 ----
rsvg_internals/src/svg.rs | 6 ++----
2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index f71a7ddd..fa7d2b6a 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -300,10 +300,6 @@ impl Handle {
draw_ctx.add_node_and_ancestors_to_stack(node);
}
- let svg_ref = self.svg.borrow();
- let svg = svg_ref.as_ref().unwrap();
- svg.cascade();
-
draw_ctx
}
diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs
index a2c61c93..8885afc2 100644
--- a/rsvg_internals/src/svg.rs
+++ b/rsvg_internals/src/svg.rs
@@ -33,6 +33,8 @@ pub struct Svg {
impl Svg {
pub fn new(tree: Tree, ids: HashMap<String, RsvgNode>, load_options: LoadOptions) -> Svg {
+ tree.cascade();
+
Svg {
tree,
ids,
@@ -71,10 +73,6 @@ impl Svg {
pub fn lookup_node_by_id(&self, id: &str) -> Option<RsvgNode> {
self.ids.get(id).map(|n| (*n).clone())
}
-
- pub fn cascade(&self) {
- self.tree.cascade();
- }
}
struct Resources {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]