[librsvg: 4/7] drawing_ctx: rename method
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/7] drawing_ctx: rename method
- Date: Mon, 20 Jan 2020 22:43:20 +0000 (UTC)
commit 337e7a2c052332c0c20bfecf6e5577d67ae5393f
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Jan 18 00:01:21 2020 +0100
drawing_ctx: rename method
rsvg_internals/src/drawing_ctx.rs | 12 ++++++------
rsvg_internals/src/node.rs | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 327921d0..30387355 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -301,8 +301,8 @@ impl DrawingCtx {
preserve_aspect_ratio
.viewport_to_viewbox_transform(vbox, &viewport)
- .and_then(|matrix| {
- self.cr.transform(matrix);
+ .and_then(|t| {
+ self.cr.transform(t);
if let Some(vbox) = vbox {
if let Some(ClipMode::ClipToVbox) = clip_mode {
@@ -355,7 +355,7 @@ impl DrawingCtx {
None
};
- self.with_saved_matrix(matrix, &mut |dc| {
+ self.with_saved_transform(matrix, &mut |dc| {
let cr = dc.get_cairo_context();
// here we don't push a layer because we are clipping
@@ -610,14 +610,14 @@ impl DrawingCtx {
initial_with_offset
}
- /// Saves the current Cairo matrix, applies a transform if specified,
- /// runs the draw_fn, and restores the original matrix
+ /// Saves the current transform, applies a new transform if specified,
+ /// runs the draw_fn, and restores the original transform
///
/// This is slightly cheaper than a `cr.save()` / `cr.restore()`
/// pair, but more importantly, it does not reset the whole
/// graphics state, i.e. it leaves a clipping path in place if it
/// was set by the `draw_fn`.
- pub fn with_saved_matrix(
+ pub fn with_saved_transform(
&mut self,
transform: Option<cairo::Matrix>,
draw_fn: &mut dyn FnMut(&mut DrawingCtx) -> Result<BoundingBox, RenderingError>,
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index ae9531e3..fa9f25e0 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -503,7 +503,7 @@ impl NodeDraw for RsvgNode {
) -> Result<BoundingBox, RenderingError> {
if !self.borrow().is_in_error() {
let transform = self.borrow().get_transform();
- draw_ctx.with_saved_matrix(Some(transform), &mut |dc| {
+ draw_ctx.with_saved_transform(Some(transform), &mut |dc| {
self.borrow()
.get_node_trait()
.draw(self, cascaded, dc, clipping)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]