diff --git a/output/src/out_impls.rs b/output/src/out_impls.rs index 755d152..34b9f47 100644 --- a/output/src/out_impls.rs +++ b/output/src/out_impls.rs @@ -204,8 +204,8 @@ impl Direction { } } -impl>> HasSize for T { - fn size (&self) -> &Measure { +impl>> Measured for T { + fn measure (&self) -> &Measure { self.get() } } diff --git a/output/src/out_traits.rs b/output/src/out_traits.rs index b004012..39abe19 100644 --- a/output/src/out_traits.rs +++ b/output/src/out_traits.rs @@ -134,6 +134,8 @@ pub trait HasWH { } // Something that has a 2D bounding box (X, Y, W, H). +// +// FIXME: The other way around? pub trait HasXYWH: HasXY + HasWH { fn x2 (&self) -> N { self.x().plus(self.w()) } fn y2 (&self) -> N { self.y().plus(self.h()) } @@ -147,9 +149,9 @@ pub trait HasXYWH: HasXY + HasWH { } } -// TODO DOCUMENTME -pub trait HasSize { - fn size (&self) -> &Measure; - fn width (&self) -> O::Unit { self.size().w() } - fn height (&self) -> O::Unit { self.size().h() } +// Something that has a [Measure] of its rendered size. +pub trait Measured { + fn measure (&self) -> &Measure; + fn measure_width (&self) -> O::Unit { self.measure().w() } + fn measure_height (&self) -> O::Unit { self.measure().h() } }