Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

fix(ui): the Move tool keeps Photoshop's arrow pointer (#5814)

midasmatterhorn88c7286d9984
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index 37415bc0c..d9414d857 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -3991,7 +3991,9 @@ pub fn canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, idx: usize, rect:
{
egui::CursorIcon::Crosshair
}
- Tool::Move => egui::CursorIcon::Move,
+ // Photoshop's Move tool keeps the standard arrow pointer (#5646): the movable
+ // layer under it is marked by the hover outline, not by a different cursor.
+ Tool::Move => egui::CursorIcon::Default,
// Dragging is handled with the pan itself, above.
Tool::Hand => crate::tool_cursor::hand(ui.ctx(), false),
Tool::RotateView => crate::rotate_view::cursor(response.dragged()),
diff --git a/crates/ui-egui/src/marquee_tests.rs b/crates/ui-egui/src/marquee_tests.rs
index 40e9bbd39..169d4588b 100644
--- a/crates/ui-egui/src/marquee_tests.rs
+++ b/crates/ui-egui/src/marquee_tests.rs
@@ -546,6 +546,15 @@ fn mouse_drag_inside_the_selection_moves_it() {
assert_eq!(selection(&h), Rect::new(120, 90, 220, 170), "moved by (20, 10)");
}
+/// #5646: the Move tool keeps Photoshop's arrow pointer instead of the 4-way move cursor (the
+/// hover outline still marks the layer under the pointer).
+#[test]
+fn the_move_tool_keeps_the_arrow_pointer() {
+ let mut h = harness(Tool::Move);
+ move_to(&mut h, 200.0, 150.0);
+ assert_eq!(h.output().platform_output.cursor_icon, egui::CursorIcon::Default);
+}
+
/// #1428: hovering inside the ants with a marquee shows the move cursor (a press there drags the
/// outline); outside it is the marquee's own cursor.
#[test]