Skip to content

Scaling text with Ctrl-+/- is irreversible on a multi-DPI setup #8309

@GregTheMadMonk

Description

@GregTheMadMonk

On my system, I have noticed that after I resize the font in the terminal on my main monitor, I cannot go back to its original size by performing the same amount of "opposite" resizes (simplest case: scale up - then scale down). I've figured out that it boils down to this line

let new_size = self.display.font_size.as_px().round() + delta;

since for my main monitor the self.display.font_size.as_px() is not an integer value, and using .round() on it essentially ensures that I cannot go back to the original font size since all other resizes will lead to an integer value again.

If a fractional font_size value is allowed (apparently it is, or it's a bug), then the round() here should be omitted. Or maybe there is a smarter solution if the fractional value is a result of changing some font size by a fractional multiplier.

System

OS: Linux
Version: alacritty 0.15.0-dev (1063706)
Linux/BSD: X11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions