summaryrefslogtreecommitdiffstats
path: root/alacritty/src/renderer/rects.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src/renderer/rects.rs')
-rw-r--r--alacritty/src/renderer/rects.rs36
1 files changed, 8 insertions, 28 deletions
diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs
index a1b1d9de..31818f60 100644
--- a/alacritty/src/renderer/rects.rs
+++ b/alacritty/src/renderer/rects.rs
@@ -8,7 +8,6 @@ use alacritty_terminal::index::{Column, Point};
use alacritty_terminal::term::cell::Flags;
use alacritty_terminal::term::color::Rgb;
-use crate::config::ui_config::Delta;
use crate::display::content::RenderableCell;
use crate::display::SizeInfo;
use crate::gl;
@@ -52,33 +51,25 @@ pub enum RectKind {
}
impl RenderLine {
- pub fn rects(
- &self,
- flag: Flags,
- metrics: &Metrics,
- size: &SizeInfo,
- offset: Delta<i8>,
- ) -> Vec<RenderRect> {
+ pub fn rects(&self, flag: Flags, metrics: &Metrics, size: &SizeInfo) -> Vec<RenderRect> {
let mut rects = Vec::new();
let mut start = self.start;
while start.line < self.end.line {
let end = Point::new(start.line, size.last_column());
- Self::push_rects(&mut rects, metrics, size, offset, flag, start, end, self.color);
+ Self::push_rects(&mut rects, metrics, size, flag, start, end, self.color);
start = Point::new(start.line + 1, Column(0));
}
- Self::push_rects(&mut rects, metrics, size, offset, flag, start, self.end, self.color);
+ Self::push_rects(&mut rects, metrics, size, flag, start, self.end, self.color);
rects
}
/// Push all rects required to draw the cell's line.
- #[allow(clippy::too_many_arguments)]
fn push_rects(
rects: &mut Vec<RenderRect>,
metrics: &Metrics,
size: &SizeInfo,
- offset: Delta<i8>,
flag: Flags,
start: Point<usize>,
end: Point<usize>,
@@ -92,7 +83,6 @@ impl RenderLine {
rects.push(Self::create_rect(
size,
- offset,
metrics.descent,
start,
end,
@@ -121,25 +111,15 @@ impl RenderLine {
_ => unimplemented!("Invalid flag for cell line drawing specified"),
};
- let mut rect = Self::create_rect(
- size,
- offset,
- metrics.descent,
- start,
- end,
- position,
- thickness,
- color,
- );
+ let mut rect =
+ Self::create_rect(size, metrics.descent, start, end, position, thickness, color);
rect.kind = ty;
rects.push(rect);
}
/// Create a line's rect at a position relative to the baseline.
- #[allow(clippy::too_many_arguments)]
fn create_rect(
size: &SizeInfo,
- offset: Delta<i8>,
descent: f32,
start: Point<usize>,
end: Point<usize>,
@@ -157,7 +137,7 @@ impl RenderLine {
let line_bottom = (start.line as f32 + 1.) * size.cell_height();
let baseline = line_bottom + descent;
- let mut y = (baseline - position - offset.y as f32 - thickness / 2.).round();
+ let mut y = (baseline - position - thickness / 2.).round();
let max_y = line_bottom - thickness;
if y > max_y {
y = max_y;
@@ -187,11 +167,11 @@ impl RenderLines {
}
#[inline]
- pub fn rects(&self, metrics: &Metrics, size: &SizeInfo, offset: Delta<i8>) -> Vec<RenderRect> {
+ pub fn rects(&self, metrics: &Metrics, size: &SizeInfo) -> Vec<RenderRect> {
self.inner
.iter()
.flat_map(|(flag, lines)| {
- lines.iter().flat_map(move |line| line.rects(*flag, metrics, size, offset))
+ lines.iter().flat_map(move |line| line.rects(*flag, metrics, size))
})
.collect()
}