Enum emath::align::Align [−][src]
pub enum Align {
Min,
Center,
Max,
}
Expand description
left/center/right or top/center/bottom alignment for e.g. anchors and layouts.
Variants
Left or top.
Horizontal or vertical center.
Right or bottom.
Implementations
👎 Deprecated:
Use Self::LEFT
👎 Deprecated:
Use Self::RIGHT
👎 Deprecated:
Use Self::TOP
👎 Deprecated:
Use Self::BOTTOM
pub fn align_size_within_range(
self,
size: f32,
range: RangeInclusive<f32>
) -> RangeInclusive<f32>
pub fn align_size_within_range(
self,
size: f32,
range: RangeInclusive<f32>
) -> RangeInclusive<f32>
assert_eq!(emath::Align::Min.align_size_within_range(2.0, 10.0..=20.0), 10.0..=12.0);
assert_eq!(emath::Align::Center.align_size_within_range(2.0, 10.0..=20.0), 14.0..=16.0);
assert_eq!(emath::Align::Max.align_size_within_range(2.0, 10.0..=20.0), 18.0..=20.0);
assert_eq!(emath::Align::Min.align_size_within_range(f32::INFINITY, 10.0..=20.0), 10.0..=f32::INFINITY);
assert_eq!(emath::Align::Center.align_size_within_range(f32::INFINITY, 10.0..=20.0), f32::NEG_INFINITY..=f32::INFINITY);
assert_eq!(emath::Align::Max.align_size_within_range(f32::INFINITY, 10.0..=20.0), f32::NEG_INFINITY..=20.0);
assert_eq!(emath::Align::Min.align_size_within_range(f32::INFINITY, 10.0..=f32::INFINITY), 10.0..=f32::INFINITY);
assert_eq!(emath::Align::Min.align_size_within_range(f32::INFINITY, f32::NEG_INFINITY..=10.0), f32::NEG_INFINITY..=10.0);
assert_eq!(emath::Align::Center.align_size_within_range(f32::INFINITY, 10.0..=f32::INFINITY), 10.0..=f32::INFINITY);
assert_eq!(emath::Align::Center.align_size_within_range(f32::INFINITY, f32::NEG_INFINITY..=10.0), f32::NEG_INFINITY..=10.0);
assert_eq!(emath::Align::Max.align_size_within_range(f32::INFINITY, 10.0..=f32::INFINITY), 10.0..=f32::INFINITY);
assert_eq!(emath::Align::Max.align_size_within_range(f32::INFINITY, f32::NEG_INFINITY..=10.0), f32::NEG_INFINITY..=10.0);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Align
impl UnwindSafe for Align
Blanket Implementations
Mutably borrows from an owned value. Read more