aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/renderer/rects.rs
diff options
context:
space:
mode:
authorii41 <23465321+ii41@users.noreply.github.com>2020-09-27 15:36:08 -0700
committerGitHub <noreply@github.com>2020-09-27 22:36:08 +0000
commita754d06b44139b85e8b34a71ece4477cb1caa85e (patch)
tree1733f8d17101947b6df5e1ad15b3fd64cf1db9a0 /alacritty/src/renderer/rects.rs
parente9c0034f4d3ee003149fe5454942bea7ff3d98be (diff)
downloadr-alacritty-a754d06b44139b85e8b34a71ece4477cb1caa85e.tar.gz
r-alacritty-a754d06b44139b85e8b34a71ece4477cb1caa85e.tar.bz2
r-alacritty-a754d06b44139b85e8b34a71ece4477cb1caa85e.zip
Add support for single line terminals
This changes the minimum terminal dimensions from 2 lines and 2 columns, to 1 line and 2 columns. This also reworks the `SizeInfo` to store the number of columns and lines and consistently has only the terminal lines/columns stored, instead of including the message bar and search in some places of the Alacritty renderer/input. These new changes also make it easy to properly start the selection scrolling as soon as the mouse is over the message bar, instead of waiting until it is beyond it. Fixes #4207. Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty/src/renderer/rects.rs')
-rw-r--r--alacritty/src/renderer/rects.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs
index 83b59cb3..ca0bbd1c 100644
--- a/alacritty/src/renderer/rects.rs
+++ b/alacritty/src/renderer/rects.rs
@@ -99,14 +99,14 @@ impl RenderLine {
mut thickness: f32,
color: Rgb,
) -> RenderRect {
- let start_x = start.col.0 as f32 * size.cell_width;
- let end_x = (end.col.0 + 1) as f32 * size.cell_width;
+ let start_x = start.col.0 as f32 * size.cell_width();
+ let end_x = (end.col.0 + 1) as f32 * size.cell_width();
let width = end_x - start_x;
// Make sure lines are always visible.
thickness = thickness.max(1.);
- let line_bottom = (start.line.0 as f32 + 1.) * size.cell_height;
+ let line_bottom = (start.line.0 as f32 + 1.) * size.cell_height();
let baseline = line_bottom + descent;
let mut y = (baseline - position - thickness / 2.).ceil();
@@ -115,7 +115,14 @@ impl RenderLine {
y = max_y;
}
- RenderRect::new(start_x + size.padding_x, y + size.padding_y, width, thickness, color, 1.)
+ RenderRect::new(
+ start_x + size.padding_x(),
+ y + size.padding_y(),
+ width,
+ thickness,
+ color,
+ 1.,
+ )
}
}