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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/actions/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

dispatch({
type: UI_FONT_SIZE_SET,
value
Expand Down