Rename geometry_for_untransformed_element -> geometry_for_element

parent 243cd2e8
......@@ -455,6 +455,16 @@ impl<'a> CairoRenderer<'a> {
.render_layer(cr, id, viewport, self.dpi, false)
}
pub fn geometry_for_element(
&self,
id: Option<&str>,
) -> Result<(cairo::Rectangle, cairo::Rectangle), RenderingError> {
self.handle
.0
.get_geometry_for_element(id, self.dpi, false)
.map(|(i, l)| (i.into(), l.into()))
}
/// Renders a single SVG element to a given viewport
///
/// This function can be used to extract individual element subtrees and render them,
......@@ -481,14 +491,4 @@ impl<'a> CairoRenderer<'a> {
.0
.render_element(cr, id, element_viewport, self.dpi, false)
}
pub fn geometry_for_untransformed_element(
&self,
id: Option<&str>,
) -> Result<(cairo::Rectangle, cairo::Rectangle), RenderingError> {
self.handle
.0
.get_untransformed_node_geometry(id, self.dpi, false)
.map(|(i, l)| (i.into(), l.into()))
}
}
......@@ -112,7 +112,7 @@ fn untransformed_element() {
/* Measuring */
let (ink_r, logical_r) = renderer
.geometry_for_untransformed_element(Some("#foo"))
.geometry_for_element(Some("#foo"))
.unwrap();
assert_eq!(
......
......@@ -369,7 +369,7 @@ impl Handle {
}
/// Returns (ink_rect, logical_rect)
pub fn get_untransformed_node_geometry(
pub fn get_geometry_for_element(
&self,
id: Option<&str>,
dpi: Dpi,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment