Repository: GraphiteEditor/Graphite
File: editor/src/messages/tool/common_functionality/shape_editor.rs (Rust)

Code before:
					return;
				}
				let polygon: Subpath<PointId> = Subpath::from_anchors_linear(polygon.to_vec(), true);
				Some(polygon)
			} else {
				None
			};

			for (id, bezier, _, _) in vector_data.segment_bezier_iter() {
				for (position, id) in [(bezier.handle_start(), ManipulatorPointId::PrimaryHandle(id)), (bezier.handle_end(), ManipulatorPointId::EndHandle(id))] {
					let Some(position) = position else { continue };
					let transformed_position = transform.transform_point2(position);

					let select = match selection_shape {
						SelectionShape::Box(quad) => quad[0].min(quad[1]).cmple(transformed_position).all() && quad[0].max(quad[1]).cmpge(transformed_position).all(),
						SelectionShape::Lasso(_) => polygon_subpath
							.as_ref()
							.expect("If `selection_shape` is a polygon then subpath is constructed beforehand.")
							.contains_point(transformed_position),
					};

					if select {
						match selection_change {
							SelectionChange::Shrink => state.deselect_point(id),
							_ => {
								// select only those handles which are of non zero length
								if let Some(handle) = id.as_handle() {
									if handle.length(&vector_data) > 0. {
										state.select_point(id)
									}
								}
							}
						}
					}
				}
			}

			for (&id, &position) in vector_data.point_domain.ids().iter().zip(vector_data.point_domain.positions()) {
				let transformed_position = transform.transform_point2(position);

				let select = match selection_shape {
					SelectionShape::Box(quad) => quad[0].min(quad[1]).cmple(transformed_position).all() && quad[0].max(quad[1]).cmpge(transformed_position).all(),
					SelectionShape::Lasso(_) => polygon_subpath
						.as_ref()
						.expect("If `selection_shape` is a polygon then subpath is constructed beforehand.")
						.contains_point(transformed_position),
				};

				if select {
					match selection_change {
						SelectionChange::Shrink => state.deselect_point(ManipulatorPointId::Anchor(id)),

Review comment (suggestion):
```suggestion
								// Select only the handles which are of nonzero length
```

Code after:
					return;
				}
				let polygon: Subpath<PointId> = Subpath::from_anchors_linear(polygon.to_vec(), true);
				Some(polygon)
			} else {
				None
			};

			for (id, bezier, _, _) in vector_data.segment_bezier_iter() {
				for (position, id) in [(bezier.handle_start(), ManipulatorPointId::PrimaryHandle(id)), (bezier.handle_end(), ManipulatorPointId::EndHandle(id))] {
					let Some(position) = position else { continue };
					let transformed_position = transform.transform_point2(position);

					let select = match selection_shape {
						SelectionShape::Box(quad) => quad[0].min(quad[1]).cmple(transformed_position).all() && quad[0].max(quad[1]).cmpge(transformed_position).all(),
						SelectionShape::Lasso(_) => polygon_subpath
							.as_ref()
							.expect("If `selection_shape` is a polygon then subpath is constructed beforehand.")
							.contains_point(transformed_position),
					};

					if select {
						match selection_change {
							SelectionChange::Shrink => state.deselect_point(id),
							_ => {
								// Select only the handles which are of nonzero length
								if let Some(handle) = id.as_handle() {
									if handle.length(&vector_data) > 0. {
										state.select_point(id)
									}
								}
							}
						}
					}
				}
			}

			for (&id, &position) in vector_data.point_domain.ids().iter().zip(vector_data.point_domain.positions()) {
				let transformed_position = transform.transform_point2(position);

				let select = match selection_shape {
					SelectionShape::Box(quad) => quad[0].min(quad[1]).cmple(transformed_position).all() && quad[0].max(quad[1]).cmpge(transformed_position).all(),
					SelectionShape::Lasso(_) => polygon_subpath
						.as_ref()
						.expect("If `selection_shape` is a polygon then subpath is constructed beforehand.")
						.contains_point(transformed_position),
				};

				if select {
					match selection_change {
						SelectionChange::Shrink => state.deselect_point(ManipulatorPointId::Anchor(id)),