diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-07-15 09:38:13 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-07-15 09:38:13 +0000 |
| commit | 9eb9a3d8a545b8307edcd283744fb7bc63e40ee6 (patch) | |
| tree | b7e11b16dc8ccc8ce563e61a4e83fd3bcf7bab40 | |
| parent | Revert "wiki: testing" (diff) | |
| parent | added font-size limitting to changelog (diff) | |
Merge pull request 'limit font size to non-negative values'
Closes https://codeberg.org/dnkl/foot/issues/38
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | terminal.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb27893..b06dc6bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,8 @@ * A multi-column character that does not fit on the current line is now printed on the next line, instead of only printing half the character. +* Font size can no longer be reduced to negative values + (https://codeberg.org/dnkl/foot/issues/38). ### Security @@ -1430,7 +1430,7 @@ term_font_size_adjust(struct terminal *term, double amount) old_pt_size = term->font_sizes[i].px_size * 72. / dpi; } - term->font_sizes[i].pt_size = old_pt_size + amount; + term->font_sizes[i].pt_size = fmax(old_pt_size + amount, 0); term->font_sizes[i].px_size = -1; } |
