Round cursor position towards top of screen

This commit is contained in:
Joscha 2022-06-13 23:14:57 +02:00
parent 1113c197f7
commit fc7b01b8c2

View file

@ -118,7 +118,7 @@ impl<I: PartialEq> Layout<I> {
fn calculate_offsets_with_cursor(&mut self, cursor: &Cursor<I>, height: i32) {
let cursor_index = self.mark_cursor(&cursor.id);
let cursor_line = ((height - 1) as f32 * cursor.proportion).round() as i32;
let cursor_line = ((height - 1) as f32 * cursor.proportion).floor() as i32;
// Propagate lines from cursor to both ends
self.blocks[cursor_index].line = cursor_line;