Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rounding bug in zoom calculation. #1426

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Conversation

lbergelson
Copy link
Contributor

Fixing a rounding error in calculateZoom. Instead of rounding to the closest integer zoom level I believe we should be rounding up to the nearest zoom level which can contain the given window.

This fixes a display issue with the ZoomSliderPanel. Certain chromosomes would display the blue mark off by 1 because it was sometimes rounding up and sometimes down.

I'm not 100% sure I understand the potential consequences of changing this for other code that relies on it, so it would be good to have a second pair of eyes on it. It seems intuitively to be correct now but it's possible the use case of "zoom level which is closest to the width of the given window" was really what was wanted. I haven't found any obvious issues with some manual testing of this change.

Fixing a rounding error  in calculateZoom.  Instead of rounding to the closest integer zoom level I believe
we should be rounding up to the nearest zoom level which can contain the given window.

This fixes a display issue with the ZoomSliderPanel.  I'm not 100% sure I understand the potential consequences
of changing thhis for other code that relies on it, so it would be good to have a second pair of eyes on it.
It seems intuitively to be correct now but it's possible the use case of "zoom level which is closest to the width of the given window"
was really what was wanted.  I haven't found any obvious issues with some manual testing of this change.
@jrobinso jrobinso merged commit 16e2e57 into master Nov 15, 2023
2 checks passed
@jrobinso jrobinso deleted the lb_fix_zoom_calculation branch November 15, 2023 19:06
jrobinso pushed a commit that referenced this pull request Dec 4, 2023
Fixing a rounding error  in calculateZoom.  Instead of rounding to the closest integer zoom level I believe
we should be rounding up to the nearest zoom level which can contain the given window.

This fixes a display issue with the ZoomSliderPanel.  I'm not 100% sure I understand the potential consequences
of changing thhis for other code that relies on it, so it would be good to have a second pair of eyes on it.
It seems intuitively to be correct now but it's possible the use case of "zoom level which is closest to the width of the given window"
was really what was wanted.  I haven't found any obvious issues with some manual testing of this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants