only set background opacity if window transparency is not 1.0

macos-click-through
Keith Simmons 3 years ago
parent 76bddae01a
commit 4982c2615e

@ -8,6 +8,7 @@ use super::{CachingShaper, RendererSettings};
use crate::editor::{Colors, Style}; use crate::editor::{Colors, Style};
use crate::settings::*; use crate::settings::*;
use crate::utils::Dimensions; use crate::utils::Dimensions;
use crate::window::WindowSettings;
pub struct GridRenderer { pub struct GridRenderer {
pub shaper: CachingShaper, pub shaper: CachingShaper,
@ -99,7 +100,8 @@ impl GridRenderer {
.set_color(style.background(&self.default_style.colors).to_color()); .set_color(style.background(&self.default_style.colors).to_color());
} }
if self.paint.color() == self.get_default_background() { if (SETTINGS.get::<WindowSettings>().transparency - 1.0).abs() > f32::EPSILON &&
self.paint.color() == self.get_default_background() {
if is_floating { if is_floating {
self.paint self.paint
.set_alpha((255.0 * SETTINGS.get::<RendererSettings>().floating_opacity) as u8); .set_alpha((255.0 * SETTINGS.get::<RendererSettings>().floating_opacity) as u8);

@ -242,7 +242,7 @@ impl RenderedWindow {
paint.set_color(default_background.with_a(a)); paint.set_color(default_background.with_a(a));
root_canvas.draw_rect(pixel_region, &paint); 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; let font_height = font_dimensions.height;

Loading…
Cancel
Save