mirror of
https://github.com/alacritty/alacritty.git
synced 2026-11-28 16:19:37 +03:00
Switch viewport before rendering rectangles
To make sure it is possible to draw over the complete window, the viewport is removed before rendering rectangles now. This makes the visual bell behave properly and flash over the padding of the terminal too, instead of just flashing the grid. However when rendering a rectangle now, the padding has to be taken into consideration.
This commit is contained in:
1 file changed
+10
@@ -675,6 +675,9 @@ impl QuadRenderer {
|
||||
// Swap program
|
||||
gl::UseProgram(self.rect_program.id);
|
||||
|
||||
// Remove padding from viewport
|
||||
gl::Viewport(0, 0, props.width as i32, props.height as i32);
|
||||
|
||||
// Change blending strategy
|
||||
gl::BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
@@ -707,6 +710,13 @@ impl QuadRenderer {
|
||||
gl::BindBuffer(gl::ARRAY_BUFFER, 0);
|
||||
gl::BindVertexArray(0);
|
||||
|
||||
// Add padding to viewport again
|
||||
let x_pad = config.padding().x as i32;
|
||||
let y_pad = config.padding().y as i32;
|
||||
let width = props.width as i32;
|
||||
let height = props.height as i32;
|
||||
gl::Viewport(x_pad, y_pad, width - 2 * y_pad, height - 2 * y_pad);
|
||||
|
||||
// Disable program
|
||||
gl::UseProgram(0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user