From f2bb1978b4ae69791a950bfde43ddb9e635de602 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Tue, 1 Dec 2026 02:00:01 -0800 Subject: [PATCH] Clear texture uploads in the headless gradient swatch fixture --- crates/ui-egui/src/gradient_preview_swatch_opacity_tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/gradient_preview_swatch_opacity_tests.rs b/crates/ui-egui/src/gradient_preview_swatch_opacity_tests.rs index 3e380c9518..9a83b1b17d 100644 --- a/crates/ui-egui/src/gradient_preview_swatch_opacity_tests.rs +++ b/crates/ui-egui/src/gradient_preview_swatch_opacity_tests.rs @@ -28,9 +28,11 @@ fn classic_gradient_opacity_changes_the_painted_swatch_only_in_classic_mode() { let draw = |app: &mut PhotocraftApp, alpha: f32| { let rect = Rect::from_min_size(Pos2::ZERO, vec2(1400.0, 180.0)); - let output = ctx.run_ui(egui::RawInput { screen_rect: Some(rect), ..Default::default() }, |ui| { + let mut output = ctx.run_ui(egui::RawInput { screen_rect: Some(rect), ..Default::default() }, |ui| { ui.horizontal(|ui| super::bar(app, ui)); }); + // This fixture inspects the paint shapes without a renderer. + output.textures_delta.clear(); let expected = Color32::from(Srgba::new(1.0, 0.0, 1.0, alpha)); assert!(output.shapes.iter().any(|clipped| mesh_has_color(&clipped.shape, expected)), "the swatch paints at alpha {alpha}"); };