[librsvg] Clarify docs for with_dpi
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Clarify docs for with_dpi
- Date: Thu, 31 Oct 2019 15:40:59 +0000 (UTC)
commit 913bdd89c8f0e4a86ce45132b9b5960ca806ae73
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Oct 31 09:18:59 2019 -0600
Clarify docs for with_dpi
librsvg_crate/src/lib.rs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/librsvg_crate/src/lib.rs b/librsvg_crate/src/lib.rs
index 5f3e999a..7fa73224 100644
--- a/librsvg_crate/src/lib.rs
+++ b/librsvg_crate/src/lib.rs
@@ -355,9 +355,10 @@ pub struct IntrinsicDimensions {
impl<'a> CairoRenderer<'a> {
/// Creates a `CairoRenderer` for the specified `SvgHandle`.
///
- /// If an SVG file has physical units like `5cm`, they must be resolved
- /// to pixel-based values. The default pixel density is `96.0` DPI in
- /// both dimensions.
+ /// The default dots-per-inch (DPI) value is set to 96; you can change it
+ /// with the [`with_dpi`] method.
+ ///
+ /// [`with_dpi`]: #method.with_dpi
pub fn new(handle: &'a SvgHandle) -> Self {
CairoRenderer {
handle,
@@ -366,6 +367,10 @@ impl<'a> CairoRenderer<'a> {
}
/// Configures the dots-per-inch for resolving physical lengths.
+ ///
+ /// If an SVG file has physical units like `5cm`, they must be resolved
+ /// to pixel-based values. The default pixel density is 96 DPI in
+ /// both dimensions.
pub fn with_dpi(self, dpi_x: f64, dpi_y: f64) -> Self {
assert!(dpi_x > 0.0);
assert!(dpi_y > 0.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]