From 4982c2615eaf9f8a55559c4bc62889ec86ec9e68 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Sun, 12 Dec 2021 21:05:01 -0800 Subject: [PATCH] only set background opacity if window transparency is not 1.0 --- src/renderer/grid_renderer.rs | 4 +++- src/renderer/rendered_window.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/grid_renderer.rs b/src/renderer/grid_renderer.rs index 8678e75..e7fd39a 100644 --- a/src/renderer/grid_renderer.rs +++ b/src/renderer/grid_renderer.rs @@ -8,6 +8,7 @@ use super::{CachingShaper, RendererSettings}; use crate::editor::{Colors, Style}; use crate::settings::*; use crate::utils::Dimensions; +use crate::window::WindowSettings; pub struct GridRenderer { pub shaper: CachingShaper, @@ -99,7 +100,8 @@ impl GridRenderer { .set_color(style.background(&self.default_style.colors).to_color()); } - if self.paint.color() == self.get_default_background() { + if (SETTINGS.get::().transparency - 1.0).abs() > f32::EPSILON && + self.paint.color() == self.get_default_background() { if is_floating { self.paint .set_alpha((255.0 * SETTINGS.get::().floating_opacity) as u8); diff --git a/src/renderer/rendered_window.rs b/src/renderer/rendered_window.rs index 1d3f27a..a6a1065 100644 --- a/src/renderer/rendered_window.rs +++ b/src/renderer/rendered_window.rs @@ -242,7 +242,7 @@ impl RenderedWindow { paint.set_color(default_background.with_a(a)); root_canvas.draw_rect(pixel_region, &paint); - paint.set_color(Color::from_argb(255, 255, 255, 255)); + paint.set_color(Color::from_argb(a, 255, 255, 255)); let font_height = font_dimensions.height;