diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-04 22:08:47 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-07 19:38:48 +0300 |
| commit | df98b5021db6dc4a6d776da8ba8884f4290a2584 (patch) | |
| tree | 258813d7c63277d018b6e7801d8faca8ab94af16 /src/layout | |
| parent | 34ce6d0b02420a8e4a5394cb4c4c603b6efef221 (diff) | |
| download | niri-df98b5021db6dc4a6d776da8ba8884f4290a2584.tar.gz niri-df98b5021db6dc4a6d776da8ba8884f4290a2584.tar.bz2 niri-df98b5021db6dc4a6d776da8ba8884f4290a2584.zip | |
layout: Mark accessors as cfg(test)
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/scrolling.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index cd75fb06..124a61db 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -328,7 +328,7 @@ impl<W: LayoutElement> ScrollingSpace<W> { pub fn update_render_elements(&mut self, is_active: bool) { let view_pos = Point::from((self.view_pos(), 0.)); - let view_size = self.view_size(); + let view_size = self.view_size; let active_idx = self.active_column_idx; for (col_idx, (col, col_x)) in self.columns_mut().enumerate() { let is_active = is_active && col_idx == active_idx; @@ -1948,7 +1948,7 @@ impl<W: LayoutElement> ScrollingSpace<W> { hint_area.loc.x -= self.view_pos(); } - let view_size = self.view_size(); + let view_size = self.view_size; // Make sure the hint is at least partially visible. if matches!(insert_hint.position, InsertPosition::NewColumn(_)) { @@ -2671,14 +2671,17 @@ impl<W: LayoutElement> ScrollingSpace<W> { } } + #[cfg(test)] pub fn view_size(&self) -> Size<f64, Logical> { self.view_size } + #[cfg(test)] pub fn clock(&self) -> &Clock { &self.clock } + #[cfg(test)] pub fn options(&self) -> &Rc<Options> { &self.options } |
