diff options
Diffstat (limited to 'alacritty_terminal/src/display.rs')
-rw-r--r-- | alacritty_terminal/src/display.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/alacritty_terminal/src/display.rs b/alacritty_terminal/src/display.rs index 8e094129..c8ef8054 100644 --- a/alacritty_terminal/src/display.rs +++ b/alacritty_terminal/src/display.rs @@ -27,7 +27,7 @@ use crate::config::{Config, StartupMode}; use crate::index::Line; use crate::message_bar::Message; use crate::meter::Meter; -use crate::renderer::rects::{Rect, Rects}; +use crate::renderer::rects::{RenderRect, RenderLines}; use crate::renderer::{self, GlyphCache, QuadRenderer}; use crate::sync::FairMutex; use crate::term::color::Rgb; @@ -511,7 +511,7 @@ impl Display { { let glyph_cache = &mut self.glyph_cache; - let mut rects = Rects::new(); + let mut lines = RenderLines::new(); // Draw grid { @@ -521,7 +521,7 @@ impl Display { // Iterate over all non-empty cells in the grid for cell in grid_cells { // Update underline/strikeout - rects.update_lines(&cell, &size_info, &metrics); + lines.update(&cell); // Draw the cell api.render_cell(cell, glyph_cache); @@ -529,14 +529,21 @@ impl Display { }); } + let mut rects = lines.into_rects(&metrics, &size_info); + if let Some(message) = message_buffer { let text = message.text(&size_info); // Create a new rectangle for the background let start_line = size_info.lines().0 - text.len(); let y = size_info.padding_y + size_info.cell_height * start_line as f32; - let rect = Rect::new(0., y, size_info.width, size_info.height - y); - rects.push(rect, message.color()); + rects.push(RenderRect::new( + 0., + y, + size_info.width, + size_info.height - y, + message.color(), + )); // Draw rectangles including the new background self.renderer.draw_rects(config, &size_info, visual_bell_intensity, rects); |