cursive-image 0.0.6

Image view for the Cursive TUI library
Documentation
//
// Sizing
//

/// Image sizing.
///
/// The default is [Fit](Self::Fit).
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub enum Sizing {
    /// Shrinks the image if it's too big.
    #[default]
    Shrink,

    /// Shrinks the image if it's too big or expands it if it's too small.
    Fit,

    /// Scale.
    Scale(f64),
}

impl Sizing {
    /// Keep the original size: [Scale](Self::Scale)(1.).
    pub fn original() -> Self {
        Self::Scale(1.)
    }
}