[librsvg: 4/9] Document c_api/sizing




commit a8d97143cc29a9b453b8d7f78e72167d3ba7df70
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed May 26 18:56:21 2021 -0500

    Document c_api/sizing

 src/c_api/sizing.rs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/c_api/sizing.rs b/src/c_api/sizing.rs
index 2c91073b..ea780296 100644
--- a/src/c_api/sizing.rs
+++ b/src/c_api/sizing.rs
@@ -1,3 +1,15 @@
+//! Compute an SVG document's size with the legacy logic.
+//!
+//! See the documentation for [`LegacySize`](trait.LegacySize.html).  The legacy C API
+//! functions like `rsvg_handle_render_cairo()` do not take a viewport argument: they do
+//! not know how big the caller would like to render the document; instead they compute a
+//! "natural size" for the document based on its `width`/`height`/`viewBox` and some
+//! heuristics for when they are missing.
+//!
+//! The new style C functions like `rsvg_handle_render_document()` actually take a
+//! viewport, which indicates how big the result should be.  This matches the expectations
+//! of the web platform, which assumes that all embedded content goes into a viewport.
+
 use crate::api::{CairoRenderer, IntrinsicDimensions, Length, RenderingError};
 use float_cmp::approx_eq;
 


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