summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:24:40 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:24:40 +0700
commitfaaa17c3a5332a74147b6d5c937e3e9bc0952ecb (patch)
tree8163cece745a3435f8faa85b37a42ffa35efc817 /native/src
parent597ef7d5fcab8e499d9d1b6b8871e78604345da7 (diff)
downloadiced-faaa17c3a5332a74147b6d5c937e3e9bc0952ecb.tar.gz
iced-faaa17c3a5332a74147b6d5c937e3e9bc0952ecb.tar.bz2
iced-faaa17c3a5332a74147b6d5c937e3e9bc0952ecb.zip
Write documentation for `iced_native::svg`
Diffstat (limited to 'native/src')
-rw-r--r--native/src/svg.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/native/src/svg.rs b/native/src/svg.rs
index 229738ee..90eff87e 100644
--- a/native/src/svg.rs
+++ b/native/src/svg.rs
@@ -1,3 +1,4 @@
+//! Load and draw vector graphics.
use crate::{Hasher, Rectangle};
use std::hash::{Hash, Hasher as _};
@@ -75,16 +76,13 @@ impl std::fmt::Debug for Data {
}
}
-/// The renderer of an [`Svg`].
-///
-/// Your [renderer] will need to implement this trait before being able to use
-/// an [`Svg`] in your user interface.
+/// A [`Renderer`] that can render vector graphics.
///
/// [renderer]: crate::renderer
pub trait Renderer: crate::Renderer {
- /// Returns the default dimensions of an [`Svg`] for the given [`Handle`].
+ /// Returns the default dimensions of an SVG for the given [`Handle`].
fn dimensions(&self, handle: &Handle) -> (u32, u32);
- // Draws an [`Svg`].
+ /// Draws an SVG with the given [`Handle`] and inside the provided `bounds`.
fn draw(&mut self, handle: Handle, bounds: Rectangle);
}