From b886ced40825372000df0fa9cddff98a1b642cc6 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 27 May 2021 14:48:45 +0200 Subject: Switch to N64 type alias --- src/layout/mod.rs | 4 ++-- src/layout/stack.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/layout') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 51b9bc64..a025fbc2 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -20,7 +20,7 @@ use std::any::Any; use std::fmt::{self, Debug, Formatter}; use std::hash::{Hash, Hasher}; -use decorum::NotNan; +use decorum::N64; use fxhash::FxHasher64; use crate::cache::{Cache, FramesEntry}; @@ -257,7 +257,7 @@ impl Regions { } /// Shrink `current` to ensure that the aspect ratio can be satisfied. - pub fn apply_aspect_ratio(&mut self, aspect: NotNan) { + pub fn apply_aspect_ratio(&mut self, aspect: N64) { let width = self.current.width.min(aspect.into_inner() * self.current.height); let height = width / aspect.into_inner(); self.current = Size::new(width, height); diff --git a/src/layout/stack.rs b/src/layout/stack.rs index bb767378..410f53c6 100644 --- a/src/layout/stack.rs +++ b/src/layout/stack.rs @@ -1,4 +1,4 @@ -use decorum::NotNan; +use decorum::N64; use super::*; @@ -13,7 +13,7 @@ pub struct StackNode { /// The fixed aspect ratio between width and height, if any. /// /// The resulting frames will satisfy `width = aspect * height`. - pub aspect: Option>, + pub aspect: Option, /// The nodes to be stacked. pub children: Vec, } @@ -58,7 +58,7 @@ impl From for AnyNode { struct StackLayouter { dirs: Gen, - aspect: Option>, + aspect: Option, main: SpecAxis, regions: Regions, finished: Vec, @@ -69,7 +69,7 @@ struct StackLayouter { } impl StackLayouter { - fn new(dirs: Gen, aspect: Option>, mut regions: Regions) -> Self { + fn new(dirs: Gen, aspect: Option, mut regions: Regions) -> Self { if let Some(aspect) = aspect { regions.apply_aspect_ratio(aspect); } -- cgit v1.2.3