Fix a porting bugs for terminal2
co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
735f2029e9
commit
12e7f61f62
6 changed files with 36 additions and 67 deletions
|
@ -186,9 +186,9 @@ pub fn mouse_side(
|
|||
}
|
||||
|
||||
pub fn grid_point(pos: Point<Pixels>, cur_size: TerminalSize, display_offset: usize) -> AlacPoint {
|
||||
let col = GridCol((cur_size.cell_width / pos.x) as usize);
|
||||
let col = GridCol((pos.x / cur_size.cell_width) as usize);
|
||||
let col = min(col, cur_size.last_column());
|
||||
let line = (cur_size.line_height / pos.y) as i32;
|
||||
let line = (pos.y / cur_size.line_height) as i32;
|
||||
let line = min(line, cur_size.bottommost_line().0);
|
||||
AlacPoint::new(GridLine(line - display_offset as i32), col)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue