Fix incorrect point types in scroll calculations (#13600)
fixes https://github.com/zed-industries/zed/issues/13559 Release Notes: - Fixed incorrect scroll behavior when using different `scroll_beyond_last_line` settings ([#13559](https://github.com/zed-industries/zed/issues/13559)) (preview only)
This commit is contained in:
parent
cb2d05b78f
commit
a695322f83
1 changed files with 2 additions and 2 deletions
|
@ -205,7 +205,7 @@ impl ScrollManager {
|
||||||
ScrollBeyondLastLine::OnePage => scroll_top,
|
ScrollBeyondLastLine::OnePage => scroll_top,
|
||||||
ScrollBeyondLastLine::Off => {
|
ScrollBeyondLastLine::Off => {
|
||||||
if let Some(height_in_lines) = self.visible_line_count {
|
if let Some(height_in_lines) = self.visible_line_count {
|
||||||
let max_row = map.max_buffer_row().as_f32();
|
let max_row = map.max_point().row().0 as f32;
|
||||||
scroll_top.min(max_row - height_in_lines + 1.).max(0.)
|
scroll_top.min(max_row - height_in_lines + 1.).max(0.)
|
||||||
} else {
|
} else {
|
||||||
scroll_top
|
scroll_top
|
||||||
|
@ -213,7 +213,7 @@ impl ScrollManager {
|
||||||
}
|
}
|
||||||
ScrollBeyondLastLine::VerticalScrollMargin => {
|
ScrollBeyondLastLine::VerticalScrollMargin => {
|
||||||
if let Some(height_in_lines) = self.visible_line_count {
|
if let Some(height_in_lines) = self.visible_line_count {
|
||||||
let max_row = map.max_buffer_row().as_f32();
|
let max_row = map.max_point().row().0 as f32;
|
||||||
scroll_top
|
scroll_top
|
||||||
.min(max_row - height_in_lines + 1. + self.vertical_scroll_margin)
|
.min(max_row - height_in_lines + 1. + self.vertical_scroll_margin)
|
||||||
.max(0.)
|
.max(0.)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue