Skip to content

Commit

Permalink
remove shadow for slice render settings overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyFunk committed Aug 23, 2023
1 parent d21a80e commit 37f3e68
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/apps/slice_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use eframe::{
egui_wgpu::wgpu::util::DeviceExt,
egui_wgpu::{self, wgpu},
};
use egui::Pos2;
use egui::{epaint::Shadow, Pos2};

// We need this for Rust to store our data correctly for the shaders
#[repr(C)]
Expand Down Expand Up @@ -473,12 +473,19 @@ impl SliceRenderer {

// Paint overlay
if self.show_settings_oberlay {
let original_visuals = ui.visuals().clone();
let mut visuals = ui.visuals().clone();
visuals.window_shadow = Shadow::NONE;
// TODO: Implement overlay transparency
// visuals.window_fill = visuals.window_fill().gamma_multiply(0.5);
ui.ctx().set_visuals(visuals);

let overlay_position = Pos2 {
x: rect.left_top().x + 2.0,
y: rect.left_top().y + 2.0,
};
egui::Window::new("Settings:")
.id(self.id)
.id(ui.next_auto_id())
.fixed_pos(overlay_position)
.default_open(false)
.resizable(false)
Expand All @@ -498,6 +505,8 @@ impl SliceRenderer {
),
};
});

ui.ctx().set_visuals(original_visuals);
}
}
}
Expand Down

0 comments on commit 37f3e68

Please sign in to comment.