forge
Explore
Log in

Don't you dare go Hollow

layout: Mark accessors as cfg(test)

Browse files at this commit

df98b5021db6dc4a6d776da8ba8884f4290a2584Ivan MolodetskikhParent: 34ce6d0
src/layout/scrolling.rsmodified+5 -2
@@ -328,7 +328,7 @@ impl<W: LayoutElement> ScrollingSpace<W> {
328 328
329 pub fn update_render_elements(&mut self, is_active: bool) {329 pub fn update_render_elements(&mut self, is_active: bool) {
330 let view_pos = Point::from((self.view_pos(), 0.));330 let view_pos = Point::from((self.view_pos(), 0.));
331- let view_size = self.view_size();331+ let view_size = self.view_size;
332 let active_idx = self.active_column_idx;332 let active_idx = self.active_column_idx;
333 for (col_idx, (col, col_x)) in self.columns_mut().enumerate() {333 for (col_idx, (col, col_x)) in self.columns_mut().enumerate() {
334 let is_active = is_active && col_idx == active_idx;334 let is_active = is_active && col_idx == active_idx;
@@ -1948,7 +1948,7 @@ impl<W: LayoutElement> ScrollingSpace<W> {
1948 hint_area.loc.x -= self.view_pos();1948 hint_area.loc.x -= self.view_pos();
1949 }1949 }
1950 1950
1951- let view_size = self.view_size();1951+ let view_size = self.view_size;
1952 1952
1953 // Make sure the hint is at least partially visible.1953 // Make sure the hint is at least partially visible.
1954 if matches!(insert_hint.position, InsertPosition::NewColumn(_)) {1954 if matches!(insert_hint.position, InsertPosition::NewColumn(_)) {
@@ -2671,14 +2671,17 @@ impl<W: LayoutElement> ScrollingSpace<W> {
2671 }2671 }
2672 }2672 }
2673 2673
2674+ #[cfg(test)]
2674 pub fn view_size(&self) -> Size<f64, Logical> {2675 pub fn view_size(&self) -> Size<f64, Logical> {
2675 self.view_size2676 self.view_size
2676 }2677 }
2677 2678
2679+ #[cfg(test)]
2678 pub fn clock(&self) -> &Clock {2680 pub fn clock(&self) -> &Clock {
2679 &self.clock2681 &self.clock
2680 }2682 }
2681 2683
2684+ #[cfg(test)]
2682 pub fn options(&self) -> &Rc<Options> {2685 pub fn options(&self) -> &Rc<Options> {
2683 &self.options2686 &self.options
2684 }2687 }