-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Zoom offsets the visible cursor #26151
Comments
We do some probing to determine if the font is monospace and determine the character width, let's call it To validate this is a problem with our monospace optimizations, can you please try disabling this optimization (i.e. |
@alexandrudima yes, with that optimization disabled cursor and selections are at the correct position when zoomed. |
I have just tried on Ubuntu 16.04 + Hack + zoom level 1 and 2 and I could not reproduce. Could you please share all your settings? Perhaps it happens at a certain
|
When I took the screenshot I had the following settings: {
"editor.fontFamily": "Hack",
"editor.fontSize": 16,
"window.zoomLevel": 4
} I am on Ubuntu 16.04 too and uploaded the file I used as example: https://gist.github.com/W4RH4WK/caeabf814c482d660b3f4c8f92a278a3 |
On Ubuntu 16.04, running 1.12.1, having the same problem. I get this on all files, but only on certain zoom levels. Font family: |
I'm sorry I could still not reproduce. I also tried rendering whitespace, since those might impact things too (and I've noticed whitespace being rendered in one of the screenshots). When I go I think I noticed some of these rounding errors in the past, so the fast view line (the one that uses multiplication) only kicks in for lines under 1000 chars: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/browser/viewParts/lines/viewLine.ts#L189 , but I never saw anything quite as bad as your screenshots. @W4RH4WK @PolarPayne |
Hmm, actually I could reproduce some weirdness in a VS Code session immediately after changing the zoom level. i.e.: change the zoom level, the positions are off. It all went away after restarting VS Code. I think there might be some sort of race between when the font is measured and the zoom level is applied. @PolarPayne @W4RH4WK Does this issue resolve itself after closing VS Code and starting it up again? |
My repro steps:
The root cause appears to be:
|
Upstream issue: electron/electron#9418 |
@PolarPayne VS Code supports two types of "zoom":
|
I recently noticed a bug where the visible editing cursor and selection are offset to where VSCode thinks the cursor is. This happens when zooming in and seems to be dependent on the font you are using.
The bug happens for me when using the Hack Font under Linux. Using that font under Windows did not result in an offset of the cursor / selection. Using Ubuntu Mono as my font did not trigger the bug, nor was increment the font size instead of zooming.
The following pictures illustrate the issue:
Correct selection using Ubuntu Mono:
Offset selection using Hack:
In both cases
node.getRight()
has been selected and hitting backspace will delete it.This also happens around the 80 column mark, not just far to the right, note the cursor ontop of the equal sign:
Steps to Reproduce:
Maybe Related:
The text was updated successfully, but these errors were encountered: