Fix docs for image

This commit is contained in:
Héctor Ramón Jiménez 2019-09-03 14:30:12 +02:00
parent 3e41c4b590
commit 2c35103035
2 changed files with 15 additions and 15 deletions

View file

@ -64,8 +64,8 @@ impl<Color, Message> Checkbox<Color, Message> {
/// * a boolean describing whether the [`Checkbox`] is checked or not /// * a boolean describing whether the [`Checkbox`] is checked or not
/// * the label of the [`Checkbox`] /// * the label of the [`Checkbox`]
/// * a function that will be called when the [`Checkbox`] is toggled. /// * a function that will be called when the [`Checkbox`] is toggled.
/// It receives the new state of the [`Checkbox`] and must produce a /// It will receive the new state of the [`Checkbox`] and must produce
/// `Message`. /// a `Message`.
/// ///
/// [`Checkbox`]: struct.Checkbox.html /// [`Checkbox`]: struct.Checkbox.html
pub fn new<F>(is_checked: bool, label: &str, f: F) -> Self pub fn new<F>(is_checked: bool, label: &str, f: F) -> Self

View file

@ -1,4 +1,4 @@
//! Displays image to your users. //! Display images in your user interface.
use crate::{ use crate::{
Element, Hasher, Layout, MouseCursor, Node, Point, Rectangle, Style, Widget, Element, Hasher, Layout, MouseCursor, Node, Point, Rectangle, Style, Widget,
@ -6,14 +6,14 @@ use crate::{
use std::hash::Hash; use std::hash::Hash;
/// A widget that displays an image. /// A frame that displays an image while keeping aspect ratio.
/// ///
/// It implements [`Widget`] when the associated [`core::Renderer`] implements /// It implements [`Widget`] when the associated `Renderer` implements the
/// the [`image::Renderer`] trait. /// [`image::Renderer`] trait.
/// ///
/// [`Widget`]: ../../core/trait.Widget.html /// [`Widget`]: ../../core/trait.Widget.html
/// [`core::Renderer`]: ../../core/trait.Renderer.html
/// [`image::Renderer`]: trait.Renderer.html /// [`image::Renderer`]: trait.Renderer.html
///
/// # Example /// # Example
/// ///
/// ``` /// ```
@ -49,7 +49,7 @@ impl<I> Image<I> {
} }
} }
/// Sets the portion of the [`Image`] that we want to draw. /// Sets the portion of the [`Image`] to draw.
/// ///
/// [`Image`]: struct.Image.html /// [`Image`]: struct.Image.html
pub fn clip(mut self, source: Rectangle<u16>) -> Self { pub fn clip(mut self, source: Rectangle<u16>) -> Self {
@ -99,21 +99,21 @@ where
} }
} }
/// The renderer of a [`Image`]. /// The renderer of an [`Image`].
/// ///
/// Your [`core::Renderer`] will need to implement this trait before being /// Your [renderer] will need to implement this trait before being able to use
/// able to use a [`Image`] in your user interface. /// an [`Image`] in your user interface.
/// ///
/// [`Image`]: struct.Image.html /// [`Image`]: struct.Image.html
/// [`core::Renderer`]: ../../core/trait.Renderer.html /// [renderer]: ../../renderer/index.html
pub trait Renderer<I> { pub trait Renderer<I> {
/// Draws a [`Image`]. /// Draws an [`Image`].
/// ///
/// It receives: /// It receives:
/// * the bounds of the [`Image`] /// * the bounds of the [`Image`]
/// * the handle of the loaded [`Image`] /// * the handle of the loaded [`Image`]
/// * the portion of the image that we wants to draw, /// * the portion of the image to draw. If not specified, the entire image
/// if not specified, draw entire image /// should be drawn.
/// ///
/// [`Image`]: struct.Image.html /// [`Image`]: struct.Image.html
fn draw( fn draw(