diff --git a/cove/src/store.rs b/cove/src/store.rs index 35e02a6..a3601a8 100644 --- a/cove/src/store.rs +++ b/cove/src/store.rs @@ -27,10 +27,6 @@ impl Path { self.0.iter().take(self.0.len() - 1) } - pub fn push(&mut self, segment: I) { - self.0.push(segment) - } - pub fn first(&self) -> &I { self.0.first().expect("path is empty") } diff --git a/cove/src/ui/chat/blocks.rs b/cove/src/ui/chat/blocks.rs index 2a9eb0a..1b91864 100644 --- a/cove/src/ui/chat/blocks.rs +++ b/cove/src/ui/chat/blocks.rs @@ -161,14 +161,6 @@ impl Blocks { pub fn shift(&mut self, delta: i32) { self.range = self.range.shifted(delta); } - - pub fn set_top(&mut self, top: i32) { - self.shift(top - self.range.top); - } - - pub fn set_bottom(&mut self, bottom: i32) { - self.shift(bottom - self.range.bottom); - } } pub struct Iter<'a, Id> { diff --git a/cove/src/ui/chat/renderer.rs b/cove/src/ui/chat/renderer.rs index 1edde46..ae0ad8f 100644 --- a/cove/src/ui/chat/renderer.rs +++ b/cove/src/ui/chat/renderer.rs @@ -275,27 +275,6 @@ where } } -pub fn clamp_scroll_biased_upwards(r: &mut R) -where - R: Renderer, -{ - let area = visible_area(r); - let blocks = r.blocks().range(); - - // Delta that moves blocks.top to the top of the screen. If this is - // negative, we need to move the blocks because they're too low. - let move_to_top = blocks.top - area.top; - - // Delta that moves blocks.bottom to the bottom of the screen. If this is - // positive, we need to move the blocks because they're too high. - let move_to_bottom = blocks.bottom - area.bottom; - - // If the screen is higher, the blocks should rather be moved to the top - // than the bottom because of the upwards bias. - let delta = 0.max(move_to_bottom).min(move_to_top); - r.blocks_mut().shift(delta); -} - pub fn clamp_scroll_biased_downwards(r: &mut R) where R: Renderer,