editor: Represent scroll offset with more precision (#39367)
Closes #5355 Release Notes: - Fixed rendering glitches with files with more than 16 million lines (that occured due to floating number rounding errors). --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This commit is contained in:
co-authored by
Smit Barmase
parent
4c35274b6e
commit
d359a814f8
@@ -275,7 +275,8 @@ impl EditorTestContext {
|
||||
let details = editor.text_layout_details(window);
|
||||
|
||||
let y = pixel_position.y
|
||||
+ line_height * (display_point.row().as_f32() - newest_point.row().as_f32());
|
||||
+ f32::from(line_height)
|
||||
* Pixels::from(display_point.row().as_f64() - newest_point.row().as_f64());
|
||||
let x = pixel_position.x + snapshot.x_for_display_point(display_point, &details)
|
||||
- snapshot.x_for_display_point(newest_point, &details);
|
||||
Point::new(x, y)
|
||||
|
||||
Reference in New Issue
Block a user