Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions editor/src/messages/tool/tool_messages/select_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,12 @@ impl Fsm for SelectToolFsmState {
{
draw_layer_outline(&mut overlay_context, document, layer, None);

if document.metadata().is_text_layer(layer) {
let layer_to_viewport = document.metadata().transform_to_viewport(layer);
let transformed_quad = layer_to_viewport * text_bounding_box(layer, document, fonts, responses);
overlay_context.dashed_quad(transformed_quad, None, None, Some(7.), Some(5.), None);
}
// if document.metadata().is_text_layer(layer) {
// debug!("This got called");
// let layer_to_viewport = document.metadata().transform_to_viewport(layer);
// let transformed_quad = layer_to_viewport * text_bounding_box(layer, document, fonts, responses);
// overlay_context.dashed_quad(transformed_quad, None, None, Some(7.), Some(5.), None);
// }
}
}

Expand Down Expand Up @@ -1125,7 +1126,7 @@ impl Fsm for SelectToolFsmState {
if let Some(intersect) = document.click(input, viewport) {
match tool_data.nested_selection_behavior {
NestedSelectionBehavior::Shallowest => edit_layer_shallowest_manipulation(document, intersect, responses),
NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),
NestedSelectionBehavior::Deepest => {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Replacing the Deepest-selection edit handler with an empty block silently disables double-click-to-edit for text/path layers in the default 'Deepest' selection mode, and leaves edit_layer_deepest_manipulation as dead code. This looks like leftover debugging rather than an intentional fix and should be reverted or reworked.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/messages/tool/tool_messages/select_tool.rs, line 1129:

<comment>Replacing the Deepest-selection edit handler with an empty block silently disables double-click-to-edit for text/path layers in the default 'Deepest' selection mode, and leaves `edit_layer_deepest_manipulation` as dead code. This looks like leftover debugging rather than an intentional fix and should be reverted or reworked.</comment>

<file context>
@@ -1125,7 +1126,7 @@ impl Fsm for SelectToolFsmState {
 					match tool_data.nested_selection_behavior {
 						NestedSelectionBehavior::Shallowest => edit_layer_shallowest_manipulation(document, intersect, responses),
-						NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),
+						NestedSelectionBehavior::Deepest => {}
 					}
 				}
</file context>
Suggested change
NestedSelectionBehavior::Deepest => {}
NestedSelectionBehavior::Deepest => edit_layer_deepest_manipulation(intersect, &document.network_interface, responses),

}
}
self
Expand Down Expand Up @@ -1710,9 +1711,11 @@ impl Fsm for SelectToolFsmState {
let selected_nodes = document.network_interface.selected_nodes();
let mut selected_layers = selected_nodes.selected_layers(document.metadata());

// this doesnt seem to get called anywhere.
if let Some(layer) = selected_layers.next() {
// Check that only one layer is selected
if selected_layers.next().is_none() && document.metadata().is_text_layer(layer) {
debug!("THIS GOT CALLED");
responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Text });
responses.add(TextToolMessage::EditSelected);
}
Expand Down