cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Hat size and position does not zoom when mouse wheel zoom is enabled

Open nriley opened this issue 8 months ago • 4 comments

The VSCode mouse wheel zoom setting (editor.mouseWheelZoom) is not enabled by default; if enabled, Cursorless hats do not zoom/position themselves accordingly.

Example at 100% scale: Image

After zooming in: Image

Or zooming out: Image

nriley avatar Jun 18 '25 13:06 nriley

Okay I think the problem is that normally the entire UI is zoomed and vscode takes care of the scaling for us. Whenever you enable editor.mouseWheelZoom you actually change the font size and we would need to recalculate the size of the font for the hats to be positioned and sized correctly. We do this whenever you change the font size setting, but not for editor.mouseWheelZoom. I'm not even sure if there is an event to listen for so we can't trigger the recalculation.

AndreasArvidsson avatar Jun 19 '25 08:06 AndreasArvidsson

I still want to be able to do this.

Should we implement a command in community that scales the font size by a given factor and makes use of the existing functionality?

Or does it make sense to have an option in Cursorless that'll recheck the font size on a regular basis, or on demand?

Or both?

nriley avatar Jun 19 '25 17:06 nriley

I will look into this further. Any changes needs to be in Cursorless. Hopefully there is at least a way to get the current font size separated from the setting. If so that is something we could check against.

AndreasArvidsson avatar Jun 19 '25 17:06 AndreasArvidsson

I have now looked into this and there isn't a way to get the current zoom level afaik. This is not a setting, but just an internal state of the vscode window that isn't exposed. Without being able to actually get the zoom level there is no way for cursorless to compensate for it.

How do you use editor.mouseWheelZoom? Could you get by with just changing the font size instead? If this needs to be dynamic I could add something to my own vscode extension to change the font size instead of relying on the vscode font size zoom. I would be happy to have a discord session about this so we can workshop the best solution.

AndreasArvidsson avatar Jun 20 '25 07:06 AndreasArvidsson