Skip to content

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

Merge PR #8186: fix(paths): the Work Path is drawn only while selected or a path tool is active (#6551)

aionggdfcdb011da59
diff --cc crates/ui-egui/src/vector_ui.rs
index 54253180e,104f514d6..78be5262c
--- a/crates/ui-egui/src/vector_ui.rs
+++ b/crates/ui-egui/src/vector_ui.rs
@@@ -1173,16 -1009,17 +1173,21 @@@ pub fn draw_overlay(app: &PhotocraftApp
crate::anchor_tools::draw_hover(app, painter, &to_scr, accent, painter.ctx().input(|i| i.modifiers));
}
} else if paths {
- // Paths remain visible as outlines with any tool. Path Selection and the Pen tools add
- // anchor squares; Direct Selection has its own overlay above.
+ // The shape's or vector mask's path stays visible as an outline with any tool. Path
+ // Selection and the Pen tools add anchor squares; Direct Selection has its own overlay
+ // above. The Work Path is drawn only while it is the path selected in the Paths panel or
+ // a path tool is active, as in Photoshop: a Work Path left unselected (one a PSD arrived
+ // with, or after Ctrl-click Load as Selection) would otherwise cover the marching ants (#6551).
let anchors = shows_anchors(tool);
- if let Some(wp) = &doc.work_path {
+ if let Some(wp) = &doc.work_path
+ && (anchors || app.ui.selected_path.as_deref() == Some("work"))
+ {
draw_path(wp, anchors);
}
+ // The saved path selected in the Paths panel is the target path (#6550).
+ if let Some(p) = selected_saved_path(app) {
+ draw_path(p, anchors);
+ }
let st = app.session.active();
if let Some(l) = st.and_then(|s| s.active_layer.and_then(|id| s.doc.layer(id)))
&& let LayerContent::Shape(sh) = &l.content