...
 
......@@ -186,14 +186,6 @@ impl Handle {
})
}
fn get_svg(&self) -> Rc<Svg> {
self.svg.clone()
}
fn get_root(&self) -> RsvgNode {
self.get_svg().root()
}
/// Returns (ink_rect, logical_rect)
fn get_node_geometry_with_viewport(
&self,
......@@ -205,7 +197,7 @@ impl Handle {
let target = ImageSurface::create(cairo::Format::Rgb24, 1, 1)?;
let cr = cairo::Context::new(&target);
let mut draw_ctx = DrawingCtx::new(
self.get_svg(),
self.svg.clone(),
Some(node),
&cr,
viewport,
......@@ -213,7 +205,7 @@ impl Handle {
true,
is_testing,
);
let root = self.get_root();
let root = self.svg.root();
draw_ctx.draw_node_from_stack(&root.get_cascaded_values(), &root, false)?;
......@@ -240,7 +232,7 @@ impl Handle {
) -> Result<(RsvgRectangle, RsvgRectangle), RenderingError> {
let node = self.get_node_or_root(id)?;
let root = self.get_root();
let root = self.svg.root();
let is_root = Rc::ptr_eq(&node, &root);
if is_root {
......@@ -278,7 +270,7 @@ impl Handle {
if let Some(id) = id {
self.lookup_node(id).map_err(RenderingError::InvalidId)
} else {
Ok(self.get_root())
Ok(self.svg.root())
}
}
......@@ -319,7 +311,7 @@ impl Handle {
return Err(DefsLookupErrorKind::CannotLookupExternalReferences);
}
match self.get_svg().lookup_node_by_id(fragment.fragment()) {
match self.svg.lookup_node_by_id(fragment.fragment()) {
Some(n) => Ok(n),
None => Err(DefsLookupErrorKind::NotFound),
}
......@@ -369,11 +361,11 @@ impl Handle {
None
};
let root = self.get_root();
let root = self.svg.root();
cr.save();
let mut draw_ctx = DrawingCtx::new(
self.get_svg(),
self.svg.clone(),
node.as_ref(),
cr,
viewport,
......@@ -414,7 +406,7 @@ impl Handle {
}
pub fn get_intrinsic_dimensions(&self) -> IntrinsicDimensions {
self.get_svg().get_intrinsic_dimensions()
self.svg.get_intrinsic_dimensions()
}
}
......