[librsvg: 2/3] Implement get_geometry_sub in terms of geometry_for_layer
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/3] Implement get_geometry_sub in terms of geometry_for_layer
- Date: Fri, 9 Oct 2020 19:57:01 +0000 (UTC)
commit a73c6e3f0ce43269481c4afb8ae6dc7f1c132639
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Oct 9 14:27:28 2020 -0500
Implement get_geometry_sub in terms of geometry_for_layer
Now the special case for getting the geometry from the intrinsic
dimensions when possible, clearly lives in this function.
rsvg_internals/src/handle.rs | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 9a6f78e8..12824dab 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -128,23 +128,7 @@ impl Handle {
}
}
- let target = cairo::ImageSurface::create(cairo::Format::Rgb24, 1, 1)?;
- let cr = cairo::Context::new(&target);
-
- let bbox = draw_tree(
- DrawingMode::LimitToStack { node, root },
- &cr,
- unit_rectangle(),
- dpi,
- true,
- is_testing,
- &mut AcquiredNodes::new(&self.document),
- )?;
-
- let ink_rect = bbox.ink_rect.unwrap_or_default();
- let logical_rect = bbox.rect.unwrap_or_default();
-
- Ok((ink_rect, logical_rect))
+ self.geometry_for_layer(node, unit_rectangle(), dpi, is_testing)
}
fn get_node_or_root(&self, id: Option<&str>) -> Result<Node, RenderingError> {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]