# git_graph: Fix commit hover misalignment after fractional scrolling \(\#53218\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d1b1f258e51fb2aa7cef8d4c2b346cf1b784ac6e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d1b1f258e51fb2aa7cef8d4c2b346cf1b784ac6e

Requested commit: d1b1f258e51fb2aa7cef8d4c2b346cf1b784ac6e

Commit: d1b1f258e51fb2aa7cef8d4c2b346cf1b784ac6e

Tree: 3042a752c90388c06ea65d2410dcc6ad8218e6b0

Author: Xin Zhao

Committer: GitHub

## Message

```
git_graph: Fix commit hover misalignment after fractional scrolling (#53218)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53199

Mathematically, `floor(A) + floor(B) != floor(A + B)`. The original code
calculated the hovered row by applying `.floor()` to the scrolled offset
and local offset separately before adding them together, which
incorrectly dropped fractional sub-pixels and caused an off-by-one
targeting error.

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
```

## Parents

- [7d8fe66f1b9357458b726a96b1ad27a7326f60e2](https://git.cafe/gitcafe/zed/commit/7d8fe66f1b9357458b726a96b1ad27a7326f60e2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d1b1f258e51fb2aa7cef8d4c2b346cf1b784ac6e?format=markdown)
