Viewer eyedropper: stay armed until there is a frame to sample

A colour pick clicked in the Composition panel before the viewer had a frame
(still rendering on a background thread, or a readback pending) sampled nothing
but was used up, leaving the colour unchanged. The click now leaves the
eyedropper armed, as the text colour eyedropper already does.

timeline_colour_eyedropper_samples_the_comp clicked without waiting for the
frame and hit this in about one run in four; it now waits for the frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pravdomil
2026-10-12 22:52:38 +02:00
co-authored by Claude Opus 5.5
parent 470ea7a3af
commit a3e2271e94
3 changed files with 54 additions and 1 deletions
@@ -1390,7 +1390,11 @@ pub fn viewer_hook(
painter.rect_stroke(sw, 2.0, Stroke::new(1.0, Color32::WHITE), egui::StrokeKind::Outside);
}
}
// No frame to sample yet (it is still rendering, or its readback is pending): the click
// leaves the eyedropper armed instead of using it up without a colour.
let unsampled = pick.kind == "color" && keyer.is_none() && app.viewer_image.is_none();
if resp.clicked()
&& !unsampled
&& let Some(pos) = resp.interact_pointer_pos()
{
let c = map.to_comp(pos);