mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
layout: Fix background color premultiplication
This commit is contained in:
@@ -77,6 +77,12 @@ impl MulAssign<f32> for Color {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Color> for Color32F {
|
||||
fn from(value: Color) -> Self {
|
||||
Color32F::from(value.to_array_premul())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
|
||||
pub struct Gradient {
|
||||
#[knuffel(property, str)]
|
||||
|
||||
@@ -77,7 +77,7 @@ impl FocusRing {
|
||||
};
|
||||
|
||||
for buf in &mut self.buffers {
|
||||
buf.set_color(color.to_array_premul());
|
||||
buf.set_color(color);
|
||||
}
|
||||
|
||||
let radius = radius.fit_to(self.full_size.w as f32, self.full_size.h as f32);
|
||||
|
||||
@@ -252,8 +252,6 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
let shadow_config =
|
||||
compute_workspace_shadow_config(options.overview.workspace_shadow, view_size);
|
||||
|
||||
let background_color = options.layout.background_color.to_array_unpremul();
|
||||
|
||||
Self {
|
||||
scrolling,
|
||||
floating,
|
||||
@@ -264,7 +262,7 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
view_size,
|
||||
working_area,
|
||||
shadow: Shadow::new(shadow_config),
|
||||
background_buffer: SolidColorBuffer::new(view_size, background_color),
|
||||
background_buffer: SolidColorBuffer::new(view_size, options.layout.background_color),
|
||||
output: Some(output),
|
||||
clock,
|
||||
base_options,
|
||||
@@ -318,8 +316,6 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
let shadow_config =
|
||||
compute_workspace_shadow_config(options.overview.workspace_shadow, view_size);
|
||||
|
||||
let background_color = options.layout.background_color.to_array_unpremul();
|
||||
|
||||
Self {
|
||||
scrolling,
|
||||
floating,
|
||||
@@ -331,7 +327,7 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
view_size,
|
||||
working_area,
|
||||
shadow: Shadow::new(shadow_config),
|
||||
background_buffer: SolidColorBuffer::new(view_size, background_color),
|
||||
background_buffer: SolidColorBuffer::new(view_size, options.layout.background_color),
|
||||
clock,
|
||||
base_options,
|
||||
options,
|
||||
@@ -421,8 +417,8 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
compute_workspace_shadow_config(options.overview.workspace_shadow, self.view_size);
|
||||
self.shadow.update_config(shadow_config);
|
||||
|
||||
let background_color = options.layout.background_color.to_array_unpremul();
|
||||
self.background_buffer.set_color(background_color);
|
||||
self.background_buffer
|
||||
.set_color(options.layout.background_color);
|
||||
|
||||
self.base_options = base_options;
|
||||
self.options = options;
|
||||
|
||||
Reference in New Issue
Block a user