#1023: the eyedropper picks from the Program monitor again

With a colour parameter's eyedropper armed (Color Key, Ultra Key, …), a
click on the Program picture did nothing: the selected clip's on-monitor
transform handles (#639) are drawn over the picture and took the click.
The clip is always selected while its effect shows in Effect Controls, so
the eyedropper never fired. While an eyedropper is armed the picture
overlays (transform handles, masks, graphics) are not drawn, so the click
reaches it; they come back once the colour is picked or Esc disarms it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NDelic 2026-10-12 11:30:31 +02:00
parent 78fe0102bd
commit d466995942
2 changed files with 32 additions and 4 deletions

View File

@ -295,10 +295,15 @@ pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect, which: Which)
monitor_view::zoom_pan_input(app, ui, which, video_area, pic, display_w, ppp);
}
if which == Which::Program && show_picture {
eyedropper(app, ui, &pic_resp, pic, target, rate, time);
crate::panels::graphics::monitor_overlay(app, ui, pic, frame_size);
crate::panels::masks::monitor_overlay(app, ui, pic, frame_size);
crate::panels::transform_handles::monitor_overlay(app, ui, pic, frame_size);
// an armed eyedropper owns clicks on the picture: the overlays would sit on top and take
// them (the selected clip's transform handles cover it, #1023)
if app.ui.eyedropper.is_some() {
eyedropper(app, ui, &pic_resp, pic, target, rate, time);
} else {
crate::panels::graphics::monitor_overlay(app, ui, pic, frame_size);
crate::panels::masks::monitor_overlay(app, ui, pic, frame_size);
crate::panels::transform_handles::monitor_overlay(app, ui, pic, frame_size);
}
}
if show_picture {
monitor_view::guides(app, ui, which, video_area, pic, frame_size);

View File

@ -577,3 +577,26 @@ fn recording_a_shortcut_skips_the_modifier_key_presses() {
assert!(got.contains("Alt+Shift+J"), "{got}");
assert!(got.contains("Cmd+K"), "{got}");
}
#[test]
fn eyedropper_picks_a_key_color_on_a_selected_clip() {
// #1023: the selected clip's transform handles covered the Program picture and took the click
let mut d = Driver::demo();
let clip = track_clips(&d.sequence(), 0)[0]["clip"].clone();
d.exec("timeline.select", json!({"clips": [clip]}));
d.exec("effects.apply", json!({"effect": "Color Key"}));
d.ok("ui.panel.show", json!({"panel": "EffectControls"}));
d.frames(4);
let color = |d: &mut Driver| d.sequence()["video"][0]["items"][0]["effects"][0]["params"]["color"]["value"].clone();
let before = color(&mut d);
d.ok("ui.click", json!({"id": "effectControls.color_key.color.eyedropper"}));
d.frames(2);
d.ok("ui.click", json!({"id": "program.picture"}));
for _ in 0..200 {
if color(&mut d) != before {
break;
}
d.frames(1);
}
assert_ne!(color(&mut d), before, "the eyedropper filled Key Color from the Program picture");
}