Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

User setting "editor.fontSize" can be a decimal but "fontshortcuts.step" cannot #3

Open
simeyla opened this issue Jun 29, 2018 · 3 comments
Labels

Comments

@simeyla
Copy link

simeyla commented Jun 29, 2018

I really want to be able to zoom in 0.5 of a font size at a time.

When I use 0.5 for fontshortcuts.step it rounds up to the next whole pixel size.

{
    "window.zoomLevel": 0,
    "editor.mouseWheelZoom": true,
    "editor.lineHeight": 0,
    "editor.fontSize": 13.5,
    "fontshortcuts.step": 0.5
}

When I enter manually a fontsize of 13.5 it is halfway between 13 and 14, so decimals are supported.
This would be very useful. I have a large 4k screen and each half point size is quite a big difference.

It looks like this is due to using Math.round when computing the value.

@pluma
Copy link
Member

pluma commented Jul 6, 2018

Good point. I have no idea where the Math.round came from.

@pluma pluma added the bug label Jul 6, 2018
@simeyla
Copy link
Author

simeyla commented Jul 8, 2018

I managed to just edit the JS myself to remove round. My guess is it was included for line-height where it is probably more necessary?

It for sure is a bit klunky using half pixel sizes, but may as well let people do it if they want :-) Or perhaps there's another way to make the increments smaller. I'm not sure why there is such a big jump between sizes when the step is set to 1.

@pluma
Copy link
Member

pluma commented Jul 9, 2018

I think the line-height also needs to be non-rounded if this is changed.

Could you maybe create a PR of your changes?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants