Ratio

Type Alias Ratio 

Source
pub type Ratio = Ratio<NonNegativeNumber>;
Expand description

A computed value.

Aliased Type§

#[repr(C)]
pub struct Ratio(pub NonNegative<f32>, pub NonNegative<f32>);

Tuple Fields§

§0: NonNegative<f32>§1: NonNegative<f32>

Implementations§

Source§

impl Ratio

Source

fn to_f32(&self) -> f32

Returns the f32 value by dividing the first value by the second one.

Source

pub fn new(a: f32, b: f32) -> Self

Returns a new Ratio.

Trait Implementations§

Source§

impl Animate for Ratio

https://drafts.csswg.org/css-values/#combine-ratio

Source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Animate a value towards another one, given an animation procedure.
Source§

impl ComputeSquaredDistance for Ratio

Source§

fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>

Computes the squared distance between two animatable values.
Source§

impl PartialOrd for Ratio

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more