mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
fix(ui): release transform handle drag after Color Picker input
This commit is contained in:
1 parent
5f575ddfe1
commit
bdaa9302ea
2 files changed
+10
-1
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user