mirror of
https://github.com/wez/wezterm.git
synced 2024-09-11 14:25:57 +03:00
macos: fix light background/border
The opengl based render first clears the window to the background color and then renders the cells over the top. on macOS I noticed a weird lighter strip to the bottom and right of the window and ran it down to the initial clear: our colors are SRGB rather than plain RGB and the discrepancy from rendering SRGB as RGB results in the color being made a brighter shade. This was less noticeable for black backgrounds.
This commit is contained in:
parent
85c70aebb7
commit
c778307b0e
@ -444,7 +444,7 @@ impl WindowCallbacks for TermWindow {
|
||||
let tab = match self.get_active_tab_or_overlay() {
|
||||
Some(tab) => tab,
|
||||
None => {
|
||||
frame.clear_color(0., 0., 0., 1.);
|
||||
frame.clear_color_srgb(0., 0., 0., 1.);
|
||||
return;
|
||||
}
|
||||
};
|
||||
@ -1545,7 +1545,7 @@ impl TermWindow {
|
||||
|
||||
let background_color = palette.resolve_bg(term::color::ColorAttribute::Default);
|
||||
let (r, g, b, a) = background_color.to_tuple_rgba();
|
||||
frame.clear_color(r, g, b, a);
|
||||
frame.clear_color_srgb(r, g, b, a);
|
||||
|
||||
let first_line_offset = if self.show_tab_bar { 1 } else { 0 };
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl WindowCallbacks for MyWindow {
|
||||
fn paint_opengl(&mut self, frame: &mut glium::Frame) {
|
||||
// Window contents are gray in opengl mode
|
||||
use glium::Surface;
|
||||
frame.clear_color(0.15, 0.15, 0.15, 1.0);
|
||||
frame.clear_color_srgb(0.15, 0.15, 0.15, 1.0);
|
||||
}
|
||||
|
||||
fn as_any(&mut self) -> &mut dyn Any {
|
||||
|
@ -129,7 +129,7 @@ pub trait WindowCallbacks: Any {
|
||||
#[cfg(feature = "opengl")]
|
||||
fn paint_opengl(&mut self, frame: &mut glium::Frame) {
|
||||
use glium::Surface;
|
||||
frame.clear_color(0.25, 0.125, 0.375, 1.0);
|
||||
frame.clear_color_srgb(0.25, 0.125, 0.375, 1.0);
|
||||
}
|
||||
|
||||
/// Called to handle a key event.
|
||||
|
Loading…
Reference in New Issue
Block a user