Skip to content

Commit 1521530

Browse files
committed
Fixes
1 parent 20bdd4b commit 1521530

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

editor/src/consts.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ pub const MIN_LENGTH_FOR_SKEW_TRIANGLE_VISIBILITY: f64 = 48.;
9999
pub const MANIPULATOR_GROUP_MARKER_SIZE: f64 = 6.;
100100
pub const SELECTION_THRESHOLD: f64 = 10.;
101101
pub const HIDE_HANDLE_DISTANCE: f64 = 3.;
102-
pub const INSERT_POINT_ON_SEGMENT_TOO_FAR_DISTANCE: f64 = 40.;
103102
pub const HANDLE_ROTATE_SNAP_ANGLE: f64 = 15.;
104-
pub const SEGMENT_INSERTION_TOLERANCE: f64 = 7.5;
103+
pub const SEGMENT_INSERTION_DISTANCE: f64 = 7.5;
105104
pub const SEGMENT_OVERLAY_SIZE: f64 = 10.;
106105

107106
// PEN TOOL

editor/src/messages/tool/tool_messages/path_tool.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use super::select_tool::extend_lasso;
22
use super::tool_prelude::*;
33
use crate::consts::{
4-
COLOR_OVERLAY_BLUE, COLOR_OVERLAY_GREEN, COLOR_OVERLAY_RED, DRAG_DIRECTION_MODE_DETERMINATION_THRESHOLD, DRAG_THRESHOLD, HANDLE_ROTATE_SNAP_ANGLE, INSERT_POINT_ON_SEGMENT_TOO_FAR_DISTANCE,
5-
SEGMENT_INSERTION_TOLERANCE, SEGMENT_OVERLAY_SIZE, SELECTION_THRESHOLD, SELECTION_TOLERANCE,
4+
COLOR_OVERLAY_BLUE, COLOR_OVERLAY_GREEN, COLOR_OVERLAY_RED, DRAG_DIRECTION_MODE_DETERMINATION_THRESHOLD, DRAG_THRESHOLD, HANDLE_ROTATE_SNAP_ANGLE, SEGMENT_INSERTION_DISTANCE,
5+
SEGMENT_OVERLAY_SIZE, SELECTION_THRESHOLD, SELECTION_TOLERANCE,
66
};
77
use crate::messages::portfolio::document::overlays::utility_functions::{path_overlays, selected_segments};
88
use crate::messages::portfolio::document::overlays::utility_types::{DrawHandles, OverlayContext};
@@ -1249,24 +1249,24 @@ impl Fsm for PathToolFsmState {
12491249
(PathToolFsmState::Ready, PathToolMessage::PointerMove { delete_segment, .. }) => {
12501250
tool_data.delete_segment_pressed = input.keyboard.get(delete_segment as usize);
12511251

1252-
// If there is a point nearby then remove the overlay
1252+
// If there is a point nearby, then remove the overlay
12531253
if shape_editor
12541254
.find_nearest_point_indices(&document.network_interface, input.mouse.position, SELECTION_THRESHOLD)
12551255
.is_some()
12561256
{
12571257
tool_data.segment = None;
12581258
responses.add(OverlaysMessage::Draw)
12591259
}
1260-
// If already hovering on a segment, then recalculate it's closest point
1260+
// If already hovering on a segment, then recalculate its closest point
12611261
else if let Some(closest_segment) = &mut tool_data.segment {
12621262
closest_segment.update_closest_point(document.metadata(), input.mouse.position);
1263-
if closest_segment.too_far(input.mouse.position, INSERT_POINT_ON_SEGMENT_TOO_FAR_DISTANCE, document.metadata()) {
1263+
if closest_segment.too_far(input.mouse.position, SEGMENT_INSERTION_DISTANCE, document.metadata()) {
12641264
tool_data.segment = None;
12651265
}
12661266
responses.add(OverlaysMessage::Draw)
12671267
}
1268-
// If not check that if there is some closest segment or not
1269-
else if let Some(closest_segment) = shape_editor.upper_closest_segment(&document.network_interface, input.mouse.position, SEGMENT_INSERTION_TOLERANCE) {
1268+
// If not, check that if there is some closest segment or not
1269+
else if let Some(closest_segment) = shape_editor.upper_closest_segment(&document.network_interface, input.mouse.position, SEGMENT_INSERTION_DISTANCE) {
12701270
tool_data.segment = Some(closest_segment);
12711271
responses.add(OverlaysMessage::Draw)
12721272
}

0 commit comments

Comments
 (0)