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 hanging when zoom out goes below 5px (#3498) #3509

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

Kacppian
Copy link
Contributor

@Kacppian Kacppian commented Mar 5, 2019

When the font size goes below 5px, xterm starts acting up and hangs. To avoid this,
the font-size is set to 5px minimum.

It's ready to be merged.

When the font size goes below 5px, xterm starts acting up and hangs. To avoid this,
the font-size is set to 5px minimum.
@@ -70,7 +70,8 @@ export function decreaseFontSize() {
effect() {
const state = getState();
const old = state.ui.fontSizeOverride || state.ui.fontSize;
const value = old - 1;
// when the font-size is really small, below 5px, xterm starts showing up issues.
const value = old > 5 ? old - 1 : old;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const value = old > 5 ? old - 1 : old;
const value = Math.max(old - 1, 5);

I prefer to use max() to floor a value, but this is a personal flavor.
Your way is totally acceptable.

@chabou chabou merged commit 90e8c1a into vercel:canary Mar 5, 2019
@chabou
Copy link
Collaborator

chabou commented Mar 5, 2019

Thank you so much for your help @Kacppian 🙏

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.

3 participants