summaryrefslogtreecommitdiff
path: root/src/renderer/lines.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/lines.rs')
-rw-r--r--src/renderer/lines.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/renderer/lines.rs b/src/renderer/lines.rs
index 99d1f28f..3c250caf 100644
--- a/src/renderer/lines.rs
+++ b/src/renderer/lines.rs
@@ -122,12 +122,15 @@ fn create_rect(
let end_x = (end.column.0 + 1) as f32 * size.cell_width;
let width = end_x - start_x;
- let (position, height) = match flag {
+ let (position, mut height) = match flag {
Flags::UNDERLINE => (metrics.underline_position, metrics.underline_thickness),
Flags::STRIKEOUT => (metrics.strikeout_position, metrics.strikeout_thickness),
_ => unimplemented!("Invalid flag for cell line drawing specified"),
};
+ // Make sure lines are always visible
+ height = height.max(1.);
+
let cell_bottom = (start.line.0 as f32 + 1.) * size.cell_height;
let baseline = cell_bottom + metrics.descent;
@@ -139,9 +142,9 @@ fn create_rect(
let rect = Rect::new(
start_x + size.padding_x,
- y + size.padding_y,
+ y.round() + size.padding_y,
width,
- height,
+ height.round(),
);
(rect, start.fg)