Revert "Round the scroll offset in editor to fix jumping text (#40401)" (#40982)

This reverts commit 3da4cddce2.

The scrolling is ~30% less for the same gesture, and I'm not using
anything lodpi:


https://github.com/user-attachments/assets/b19521fc-9e29-4bfd-9660-dc1e4c8ae846


Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-10-23 12:25:36 +03:00 committed by GitHub
parent 16f7bd0a2e
commit 3bb4c94ed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7232,16 +7232,9 @@ impl EditorElement {
* ScrollPixelOffset::from(max_glyph_advance)
- ScrollPixelOffset::from(delta.x * scroll_sensitivity))
/ ScrollPixelOffset::from(max_glyph_advance);
let scale_factor = window.scale_factor();
let y = (current_scroll_position.y
* ScrollPixelOffset::from(line_height)
* ScrollPixelOffset::from(scale_factor)
let y = (current_scroll_position.y * ScrollPixelOffset::from(line_height)
- ScrollPixelOffset::from(delta.y * scroll_sensitivity))
.round()
/ ScrollPixelOffset::from(line_height)
/ ScrollPixelOffset::from(scale_factor);
/ ScrollPixelOffset::from(line_height);
let mut scroll_position =
point(x, y).clamp(&point(0., 0.), &position_map.scroll_max);
let forbid_vertical_scroll = editor.scroll_manager.forbid_vertical_scroll();