mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Fix incorrect color fringe colors on SVG:s (#7069)
This is a problem that affected the fringes on all SVG:s with transparency, especially on a light background. ## Before  ## After 
This commit is contained in:
@@ -100,6 +100,7 @@ impl Default for DemoGroups {
|
||||
Box::<super::tests::InputTest>::default(),
|
||||
Box::<super::tests::LayoutTest>::default(),
|
||||
Box::<super::tests::ManualLayoutTest>::default(),
|
||||
Box::<super::tests::SvgTest>::default(),
|
||||
Box::<super::tests::TessellationTest>::default(),
|
||||
Box::<super::tests::WindowResizeTest>::default(),
|
||||
]),
|
||||
|
||||
@@ -6,6 +6,7 @@ mod input_event_history;
|
||||
mod input_test;
|
||||
mod layout_test;
|
||||
mod manual_layout_test;
|
||||
mod svg_test;
|
||||
mod tessellation_test;
|
||||
mod window_resize_test;
|
||||
|
||||
@@ -17,5 +18,6 @@ pub use input_event_history::InputEventHistory;
|
||||
pub use input_test::InputTest;
|
||||
pub use layout_test::LayoutTest;
|
||||
pub use manual_layout_test::ManualLayoutTest;
|
||||
pub use svg_test::SvgTest;
|
||||
pub use tessellation_test::TessellationTest;
|
||||
pub use window_resize_test::WindowResizeTest;
|
||||
|
||||
32
crates/egui_demo_lib/src/demo/tests/svg_test.rs
Normal file
32
crates/egui_demo_lib/src/demo/tests/svg_test.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
pub struct SvgTest {
|
||||
color: egui::Color32,
|
||||
}
|
||||
|
||||
impl Default for SvgTest {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
color: egui::Color32::LIGHT_RED,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::Demo for SvgTest {
|
||||
fn name(&self) -> &'static str {
|
||||
"SVG Test"
|
||||
}
|
||||
|
||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
||||
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
|
||||
use crate::View as _;
|
||||
self.ui(ui);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::View for SvgTest {
|
||||
fn ui(&mut self, ui: &mut egui::Ui) {
|
||||
let Self { color } = self;
|
||||
ui.color_edit_button_srgba(color);
|
||||
ui.add(egui::Image::new(egui::include_image!("../../../data/peace.svg")).tint(*color));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user