# editor: Fix movement mismatch between minimap thumb and cursor \(\#62087\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 90731bdec056817dd6dc53c6af56f016b9ec0655

Requested commit: 90731bdec056817dd6dc53c6af56f016b9ec0655

Commit: 90731bdec056817dd6dc53c6af56f016b9ec0655

Tree: c8861ef31aca492993ad1d02a53c83c5c40fca59

Author: Yue Fei

Committer: GitHub

## Message

```
editor: Fix movement mismatch between minimap thumb and cursor (#62087)

# Objective

Fixes #44824

This bug results from an incorrect mathematical derivation of the
`pixels_per_line` calculation formula. The complete derivation is too
lengthy to include here, so it is provided in a separate comment below.

This PR does the same thing as #60080, but it is a refined version of
it.

## Solution

Replace the previous incorrect calculation formula with the correct one.

## Testing

These changes are manually tested on my computer and all worked as
expected.

## Self-Review Checklist:

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

## Showcase

This recording shows the behavior in short document environment:


https://github.com/user-attachments/assets/2e5e7aec-ccf2-47c3-a046-e7f668bdb6c0

While this one shows the behavior in long document environment:


https://github.com/user-attachments/assets/e5809c81-4cfb-45f9-8ec7-051a487bd6f7

It's apparent that the minimap thumb moves closely with the cursor in
both environments.

---

Release Notes:

- Fixed movement mismatch between minimap thumb and cursor.

---------

Co-authored-by: Finn Evers <finn@zed.dev>
```

## Parents

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

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