Fixing issue with x-axis desyncing

This commit is contained in:
ellieplayswow 2025-02-18 13:58:00 +00:00
parent e774ea1774
commit 169d8ef365

View file

@ -2244,13 +2244,17 @@ impl Tab {
y: scroll_y as f32 y: scroll_y as f32
}; };
if let Some(offset) = self.virtual_cursor_offset { if let Some(virtual_cursor_offset) = self.virtual_cursor_offset {
new_offset = Point { new_offset = Point {
x: new_offset.x + offset.x, x: new_offset.x + virtual_cursor_offset.x,
y: new_offset.y + offset.y, y: new_offset.y + virtual_cursor_offset.y,
}; };
} }
if let Some(last_scroll_position) = self.last_scroll_position {
new_offset.x = (pos.x - last_scroll_position.x);
}
self.virtual_cursor_offset = Some(new_offset); self.virtual_cursor_offset = Some(new_offset);
self.last_scroll_offset = Some(new_offset); self.last_scroll_offset = Some(new_offset);