[librsvg] Add doc comment to DrawingCtx.push_new_viewport



commit 27862d30eb56fe2bda876fb261cde250461d4d0f
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Apr 30 20:05:49 2020 -0500

    Add doc comment to DrawingCtx.push_new_viewport
    
    Especially to note that this function changes the current cr's
    transform, but does not restore it afterwards.

 rsvg_internals/src/drawing_ctx.rs | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index e64f0963..6e7b90ba 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -273,6 +273,12 @@ impl DrawingCtx {
         }
     }
 
+    /// Creates a new coordinate space inside a viewport.
+    ///
+    /// Note that this actually changes the `draw_ctx.cr`'s transformation to match
+    /// the new coordinate space, but the old one is not restored after the
+    /// result's `ViewParams` is dropped.  Thus, this function must be called
+    /// inside `draw_ctx.with_saved_cr` or `draw_ctx.with_discrete_layer`.
     pub fn push_new_viewport(
         &self,
         vbox: Option<ViewBox>,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]