[librsvg] aspect_ratio.rs: Initial docs



commit fd24f04c061412325ed4c0d13dff675090baf75b
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Feb 1 14:12:01 2017 -0600

    aspect_ratio.rs: Initial docs

 rust/src/aspect_ratio.rs |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/aspect_ratio.rs b/rust/src/aspect_ratio.rs
index d72b1f9..07438b1 100644
--- a/rust/src/aspect_ratio.rs
+++ b/rust/src/aspect_ratio.rs
@@ -1,3 +1,21 @@
+//! Handling of preserveAspectRatio values
+//!
+//! This module handles preserveAspectRatio values [per the SVG specification][spec].
+//! We have an [`AspectRatio`] struct which encapsulates such a value.
+//!
+//! [`AspectRatio`] implements `FromStr`, so it can be parsed easily:
+//!
+//! ```
+//! assert_eq! (AspectRatio::from_str ("XmidYmid"),
+//!             Ok (AspectRatio { defer: false,
+//!                               align: Align::Aligned { align: AlignMode::XmidYmid,
+//!                                                       fit: FitMode::Meet } }));
+//! ```
+//!
+//! [`AspectRatio`]: struct.AspectRatio.html
+//! [spec]: https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
+
+
 use std::fmt;
 use std::str::FromStr;
 


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