Document the Eyedropper sample and mask fixture

This commit is contained in:
yoriswind committed 2026-11-07 01:19:26 -08:00
1 parent c2ce77df77
commit d40d8a5278
2 files changed
+3

No files matched your search

+2
View File
@@ -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)
@@ -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();