We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1ce796 commit 158f18dCopy full SHA for 158f18d
node-graph/gcore/src/vector/vector_data.rs
@@ -519,7 +519,10 @@ impl HandleId {
519
520
/// Calculate the magnitude of the handle from the anchor.
521
pub fn length(self, vector_data: &VectorData) -> f64 {
522
- let anchor_position = self.to_manipulator_point().get_anchor_position(vector_data).unwrap();
+ let Some(anchor_position) = self.to_manipulator_point().get_anchor_position(vector_data) else {
523
+ // TODO: This was previously an unwrap which was encountered, so this is a temporary way to avoid a crash
524
+ return 0.;
525
+ };
526
let handle_position = self.to_manipulator_point().get_position(vector_data);
527
handle_position.map(|pos| (pos - anchor_position).length()).unwrap_or(f64::MAX)
528
}
0 commit comments