fix pageUp/pageDown scrolling
This commit is contained in:
@@ -110,11 +110,12 @@ fn handle_page_scroll(
|
|||||||
total_lines: usize,
|
total_lines: usize,
|
||||||
) {
|
) {
|
||||||
if let Some(direction) = tab.page_scroll_direction.take() {
|
if let Some(direction) = tab.page_scroll_direction.take() {
|
||||||
|
let row_height_offset = row_height + 3f32;
|
||||||
let viewport_height = ui.available_height();
|
let viewport_height = ui.available_height();
|
||||||
let rows_per_page = (viewport_height / row_height).floor().max(1.0);
|
let rows_per_page = (viewport_height / row_height_offset).floor().max(1.0);
|
||||||
let scroll_delta = direction * rows_per_page * row_height;
|
let scroll_delta = direction * rows_per_page * row_height_offset;
|
||||||
|
|
||||||
let max_offset = (total_lines as f32 * row_height - viewport_height).max(0.0);
|
let max_offset = (total_lines as f32 * row_height_offset - viewport_height).max(0.0);
|
||||||
let new_offset = (tab.desired_scroll_offset + scroll_delta).clamp(0.0, max_offset);
|
let new_offset = (tab.desired_scroll_offset + scroll_delta).clamp(0.0, max_offset);
|
||||||
|
|
||||||
eprintln!(
|
eprintln!(
|
||||||
|
|||||||
Reference in New Issue
Block a user