Skip to content

Commit d1cd163

Browse files
committed
remove region from viewport
1 parent dbc9f95 commit d1cd163

File tree

1 file changed

+1
-12
lines changed
  • anathema-widgets/src/layout

1 file changed

+1
-12
lines changed

anathema-widgets/src/layout/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,35 +133,24 @@ impl<'frame, 'bp> EvalCtx<'frame, 'bp> {
133133
/// A viewport represents the available space in the root
134134
pub struct Viewport {
135135
size: Size,
136-
region: Region,
137136
}
138137

139138
impl Viewport {
140139
pub fn new(size: impl Into<Size>) -> Self {
141140
let size = size.into();
142-
let region = Region::from((Pos::ZERO, size));
143-
Self { size, region }
141+
Self { size }
144142
}
145143

146144
pub fn size(&self) -> Size {
147145
self.size
148146
}
149147

150-
pub fn region(&self) -> &Region {
151-
&self.region
152-
}
153-
154148
pub fn constraints(&self) -> Constraints {
155149
Constraints::new(self.size.width, self.size.height)
156150
}
157151

158152
pub fn resize(&mut self, size: Size) {
159153
self.size = size;
160-
self.region = Region::from((Pos::ZERO, size));
161-
}
162-
163-
pub fn contains(&self, region: Region) -> bool {
164-
self.region.intersects(&region)
165154
}
166155
}
167156

0 commit comments

Comments
 (0)