1
0
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

![image](https://github.com/user-attachments/assets/342823ad-005c-4f82-83a6-d2dcccfd3221)


## After

![image](https://github.com/user-attachments/assets/73398265-d333-461b-8c2b-fce405d95a9c)
This commit is contained in:
Emil Ernerfeldt
2025-05-21 17:18:36 +02:00
committed by GitHub
parent f23618701f
commit 54ae2360ec
6 changed files with 49 additions and 3 deletions

View File

@@ -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(),
]),

View File

@@ -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;

View 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));
}
}