diff --git a/crates/ui-egui/src/canvas/cursors.rs b/crates/ui-egui/src/canvas/cursors.rs index d7fedca6df..e692c4fe07 100644 --- a/crates/ui-egui/src/canvas/cursors.rs +++ b/crates/ui-egui/src/canvas/cursors.rs @@ -203,6 +203,8 @@ pub(super) fn alt_eyedropper(app: &mut PhotocraftApp, ev: ToolEvent, mods: egui: true } +/// Sample the image or targeted raster mask at (x, y) using the configured Sample Size. +/// Write a valid sample to the foreground swatch, or to the background swatch with Alt. pub(super) fn sample_eyedropper(app: &mut PhotocraftApp, x: f64, y: f64, mods: egui::Modifiers) { let rgb = if let Some((surface, canvas)) = eyedropper_mask_source(app) { sample_layer_mask(surface, canvas, x, y, app.ui.tool_options.eyedropper_size) diff --git a/crates/ui-egui/src/eyedropper_mask_sample_tests.rs b/crates/ui-egui/src/eyedropper_mask_sample_tests.rs index 671d04b345..d36de6b33c 100644 --- a/crates/ui-egui/src/eyedropper_mask_sample_tests.rs +++ b/crates/ui-egui/src/eyedropper_mask_sample_tests.rs @@ -8,6 +8,7 @@ use crate::{PhotocraftApp, Services}; const RED: [f32; 4] = [1.0, 0.0, 0.0, 1.0]; +/// Select the Eyedropper and target a fully revealed mask on a red pixel layer or an Invert adjustment above it. fn app_with_mask(adjustment: bool) -> PhotocraftApp { let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Services::default()); app.run("file.new", json!({"width": 8, "height": 8, "background": "transparent"})).unwrap();