fix(ui): release transform handle drag after Color Picker input

This commit is contained in:
yoriswind committed 2026-11-04 18:29:05 -08:00
1 parent 5f575ddfe1
commit bdaa9302ea
2 files changed
+10 -1

No files matched your search

+3 -1
View File
@@ -1273,7 +1273,9 @@ fn pointer_eyedropper_took(app: &mut PhotocraftApp, ctx: &egui::Context, g: &Poi
let down = matches!(s.ev, ToolEvent::Down { .. });
// With the Color Picker on top the image is its eyedropper, as for the mouse.
if crate::color_picker_ui::top(app).is_some() {
if !matches!(s.ev, ToolEvent::Up { .. }) {
if matches!(s.ev, ToolEvent::Up { .. }) {
crate::tools::transform_tool::release_handle_drag(app);
} else {
crate::color_picker_ui::sample_at(app, x, y);
}
return true;
@@ -246,6 +246,13 @@ pub fn handle_tolerance(app: &PhotocraftApp) -> f64 {
HANDLE_PX / app.point_zoom().max(0.01) as f64
}
/// End a handle drag whose release a modal sampler consumed, preserving the transform.
pub(crate) fn release_handle_drag(app: &mut PhotocraftApp) {
if let Some(preview) = app.transform_preview.as_mut() {
preview.gesture = None;
}
}
/// The box as one undo step restores it.
#[derive(Clone, Debug, PartialEq)]
struct Step {