mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-02-21 18:49:04 +01:00
refactor(layout): prefix methods (13 errors)
This commit is contained in:
parent
d5976cae8e
commit
b7b1055fbc
3 changed files with 125 additions and 108 deletions
|
|
@ -73,16 +73,16 @@ pub trait Lay<O: Out>: Sized {}
|
|||
|
||||
/// Drawable area of display.
|
||||
pub trait Layout<O: Out> {
|
||||
fn x (&self, to: XYWH<O::Unit>) -> O::Unit { to.x() }
|
||||
fn y (&self, to: XYWH<O::Unit>) -> O::Unit { to.y() }
|
||||
fn w_min (&self, _t: XYWH<O::Unit>) -> O::Unit { 0.into() }
|
||||
fn w_max (&self, to: XYWH<O::Unit>) -> O::Unit { to.w() }
|
||||
fn w (&self, to: XYWH<O::Unit>) -> O::Unit { to.w().max(self.w_min(to)).min(self.w_max(to)) }
|
||||
fn h_min (&self, _t: XYWH<O::Unit>) -> O::Unit { 0.into() }
|
||||
fn h_max (&self, to: XYWH<O::Unit>) -> O::Unit { to.h() }
|
||||
fn h (&self, to: XYWH<O::Unit>) -> O::Unit { to.h().max(self.h_min(to)).min(self.h_max(to)) }
|
||||
fn layout_x (&self, to: XYWH<O::Unit>) -> O::Unit { to.x() }
|
||||
fn layout_y (&self, to: XYWH<O::Unit>) -> O::Unit { to.y() }
|
||||
fn layout_w_min (&self, _t: XYWH<O::Unit>) -> O::Unit { 0.into() }
|
||||
fn layout_w_max (&self, to: XYWH<O::Unit>) -> O::Unit { to.w() }
|
||||
fn layout_w (&self, to: XYWH<O::Unit>) -> O::Unit { to.w().max(self.layout_w_min(to)).min(self.layout_w_max(to)) }
|
||||
fn layout_h_min (&self, _t: XYWH<O::Unit>) -> O::Unit { 0.into() }
|
||||
fn layout_h_max (&self, to: XYWH<O::Unit>) -> O::Unit { to.h() }
|
||||
fn layout_h (&self, to: XYWH<O::Unit>) -> O::Unit { to.h().max(self.layout_h_min(to)).min(self.layout_h_max(to)) }
|
||||
fn layout (&self, to: XYWH<O::Unit>) -> XYWH<O::Unit> {
|
||||
XYWH(self.x(to), self.y(to), self.w(to), self.h(to))
|
||||
XYWH(self.layout_x(to), self.layout_y(to), self.layout_w(to), self.layout_h(to))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue