Round cursor position towards top of screen
This commit is contained in:
parent
1113c197f7
commit
fc7b01b8c2
1 changed files with 1 additions and 1 deletions
|
|
@ -118,7 +118,7 @@ impl<I: PartialEq> Layout<I> {
|
||||||
|
|
||||||
fn calculate_offsets_with_cursor(&mut self, cursor: &Cursor<I>, height: i32) {
|
fn calculate_offsets_with_cursor(&mut self, cursor: &Cursor<I>, height: i32) {
|
||||||
let cursor_index = self.mark_cursor(&cursor.id);
|
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
|
// Propagate lines from cursor to both ends
|
||||||
self.blocks[cursor_index].line = cursor_line;
|
self.blocks[cursor_index].line = cursor_line;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue