Conversation
3697b7d to
90533e6
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request extends the 'Make Path Editable' functionality to support Table<Graphic> layers. The changes in utility_functions.rs are correct, but the related logic in path_tool.rs for identifying vector layers was not updated consistently, which could lead to incorrect behavior. I've pointed out this inconsistency and also suggested a refactoring to improve code clarity and performance.
| let is_vector_layer = if let Some(node) = node_id { | ||
| let output_connector = OutputConnector::node(node, 0); | ||
| let output_type = document.network_interface.output_type(&output_connector, &[]); | ||
| output_type.compiled_nested_type() == Some(&concrete!(Table<Vector>)) | ||
| } else { | ||
| false | ||
| }; |
There was a problem hiding this comment.
The logic to identify a vector layer should also include Table<Graphic> to be consistent with the changes in make_path_editable_is_allowed. Currently, it only checks for Table<Vector>, which could lead to the path tool incorrectly trying to drill down into Graphic layers instead of treating them as editable paths.
| let is_vector_layer = if let Some(node) = node_id { | |
| let output_connector = OutputConnector::node(node, 0); | |
| let output_type = document.network_interface.output_type(&output_connector, &[]); | |
| output_type.compiled_nested_type() == Some(&concrete!(Table<Vector>)) | |
| } else { | |
| false | |
| }; | |
| let is_vector_layer = if let Some(node) = node_id { | |
| let output_connector = OutputConnector::node(node, 0); | |
| let output_type = document.network_interface.output_type(&output_connector, &[]); | |
| let ty = output_type.compiled_nested_type(); | |
| ty == Some(&concrete!(Table<Vector>)) || ty == Some(&concrete!(Table<Graphic>)) | |
| } else { | |
| false | |
| }; |
PR1-
https://discord.com/channels/731730685944922173/731738914812854303/1469781624337203493 issue link from discord group .