File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2867,9 +2867,9 @@ impl HexEditor {
28672867 fn recompute_logical_row_from_offset ( & mut self , row_count : usize , offset : gpui:: Pixels ) {
28682868 let row_height = self . row_height ( ) ;
28692869 let actual_total_height = row_count as f64 * row_height;
2870- if actual_total_height > 10_000_000.0 {
2870+ if actual_total_height > ui :: MAX_VIRTUAL_HEIGHT {
28712871 let scroll_abs = ( -f64:: from ( f32:: from ( offset) ) ) . max ( 0.0 ) ;
2872- let scroll_ratio = ( scroll_abs / 10_000_000.0 ) . clamp ( 0.0 , 1.0 ) ;
2872+ let scroll_ratio = ( scroll_abs / ui :: MAX_VIRTUAL_HEIGHT ) . clamp ( 0.0 , 1.0 ) ;
28732873 let first_visible = ( scroll_ratio * row_count as f64 ) . floor ( ) as usize ;
28742874 self . tab_mut ( ) . scroll_logical_row = Some ( first_visible) ;
28752875 }
Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ pub const ROW_HEIGHT: f64 = 24.0;
364364
365365/// Maximum virtual height to avoid f32 precision issues
366366/// f32 loses precision above ~16 million, so we cap at 10 million pixels
367- const MAX_VIRTUAL_HEIGHT : f64 = 10_000_000.0 ;
367+ pub const MAX_VIRTUAL_HEIGHT : f64 = 10_000_000.0 ;
368368
369369/// Buffer rows above/below visible area to prevent flickering during scroll
370370const BUFFER_ROWS : usize = 10 ;
You can’t perform that action at this time.
0 commit comments