|
|
@ -1,4 +1,3 @@
|
|
|
|
use crate::WindowSettings;
|
|
|
|
|
|
|
|
use std::sync::Arc;
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
|
|
|
|
use glutin::dpi::PhysicalSize;
|
|
|
|
use glutin::dpi::PhysicalSize;
|
|
|
@ -75,16 +74,7 @@ impl GridRenderer {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn get_default_background(&self) -> Color {
|
|
|
|
pub fn get_default_background(&self) -> Color {
|
|
|
|
let mut transparency = { SETTINGS.get::<WindowSettings>().transparency };
|
|
|
|
self.default_style.colors.background.unwrap().to_color()
|
|
|
|
if transparency < 1.0 {
|
|
|
|
|
|
|
|
transparency = 0.0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
self.default_style
|
|
|
|
|
|
|
|
.colors
|
|
|
|
|
|
|
|
.background
|
|
|
|
|
|
|
|
.unwrap()
|
|
|
|
|
|
|
|
.to_color()
|
|
|
|
|
|
|
|
.with_a((255.0 * transparency) as u8)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn draw_background(
|
|
|
|
pub fn draw_background(
|
|
|
@ -108,7 +98,7 @@ 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().with_a(255) {
|
|
|
|
if self.paint.color() == self.get_default_background() {
|
|
|
|
self.paint.set_alpha(0);
|
|
|
|
self.paint.set_alpha(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
canvas.draw_rect(region, &self.paint);
|
|
|
|
canvas.draw_rect(region, &self.paint);
|
|
|
|