From 228400a6c24bf651ecd74996d1fa68c3d92c9ff9 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Fri, 5 Jan 2018 03:22:58 +0000 Subject: Prevent font_size_modifier from sinking too low (#994) This replaces the `font_size_modifier` stored on the `Term` struct with a `font_size` field. With this change it is not necessary anymore to calculate the new font size from a delta but the current font size is always stored directly on the `Term` struct. As a result of this it is now possible to increase the font size by more than 127 steps at runtime. It also limits the minimum font size to 1, so issues with the `font_size_modifier` dropping far below font size 1 are resolved with this change. This fixes #955. --- font/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'font') diff --git a/font/src/lib.rs b/font/src/lib.rs index ad1f4f80..330ed362 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -166,7 +166,7 @@ impl Hash for GlyphKey { } /// Font size stored as integer -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Size(i16); impl Size { -- cgit v1.2.3