diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/config.rs b/src/config.rs index ba1ae5f8..61bdb256 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1189,6 +1189,12 @@ impl FontOffset { } } +impl Default for FontOffset { + fn default() -> FontOffset { + FontOffset { x: 0.0, y: 0.0 } + } +} + trait DeserializeFromF32 : Sized { fn deserialize_from_f32<D>(D) -> ::std::result::Result<Self, D::Error> where D: serde::de::Deserializer; @@ -1301,10 +1307,7 @@ impl Default for Font { italic: FontDescription::new_with_family("Menlo"), size: Size::new(11.0), use_thin_strokes: true, - offset: FontOffset { - x: 0.0, - y: 0.0 - } + offset: Default::default() } } } @@ -1318,12 +1321,7 @@ impl Default for Font { italic: FontDescription::new_with_family("monospace"), size: Size::new(11.0), use_thin_strokes: false, - offset: FontOffset { - // TODO should improve freetype metrics... shouldn't need such - // drastic offsets for the default! - x: 2.0, - y: -7.0 - } + offset: Default::default() } } } |