diff options
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/renderer/text/builtin_font.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/alacritty/src/renderer/text/builtin_font.rs b/alacritty/src/renderer/text/builtin_font.rs index aeee6d91..c0355be6 100644 --- a/alacritty/src/renderer/text/builtin_font.rs +++ b/alacritty/src/renderer/text/builtin_font.rs @@ -37,8 +37,9 @@ pub fn builtin_glyph( } fn box_drawing(character: char, metrics: &Metrics, offset: &Delta<i8>) -> RasterizedGlyph { - let height = (metrics.line_height as i32 + offset.y as i32) as usize; - let width = (metrics.average_advance as i32 + offset.x as i32) as usize; + // Ensure that width and height is at least one. + let height = (metrics.line_height as i32 + offset.y as i32).max(1) as usize; + let width = (metrics.average_advance as i32 + offset.x as i32).max(1) as usize; // Use one eight of the cell width, since this is used as a step size for block elemenets. let stroke_size = cmp::max((width as f32 / 8.).round() as usize, 1); let heavy_stroke_size = stroke_size * 2; |