Remove unused code

This commit is contained in:
Joscha 2024-01-02 18:25:31 +01:00
parent a1b0e151ff
commit 956d3013ea
3 changed files with 0 additions and 33 deletions

View file

@ -27,10 +27,6 @@ impl<I> Path<I> {
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")
}

View file

@ -161,14 +161,6 @@ impl<Id> Blocks<Id> {
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> {

View file

@ -275,27 +275,6 @@ where
}
}
pub fn clamp_scroll_biased_upwards<Id, R>(r: &mut R)
where
R: Renderer<Id>,
{
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<Id, R>(r: &mut R)
where
R: Renderer<Id>,