diff --git a/crates/ui-egui/src/panels/info_color_samplers_toggle_tests.rs b/crates/ui-egui/src/panels/info_color_samplers_toggle_tests.rs index 7ed63c8dfa..dff51d0749 100644 --- a/crates/ui-egui/src/panels/info_color_samplers_toggle_tests.rs +++ b/crates/ui-egui/src/panels/info_color_samplers_toggle_tests.rs @@ -105,7 +105,8 @@ fn sampler_mark(shape: &Shape, at: Pos2) -> bool { } fn shows_marker(h: &AppHarness) -> bool { - let at = to_screen(h.state(), POINT); + // The engine stores the pixel centre, but the shared ColorSamplers collection uses the pixel index to paint. + let at = to_screen(h.state(), POINT.map(f64::floor)); h.output().shapes.iter().any(|clipped| clipped.clip_rect.contains(at) && sampler_mark(&clipped.shape, at)) }