Skip to content

Commit 63d890f

Browse files
committed
removed unnecessary code
1 parent e96d718 commit 63d890f

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,21 +306,18 @@ impl Fsm for GradientToolFsmState {
306306
overlay_context.gradient_handle(start.lerp(end, position), dragging == Some(GradientDragTarget::Step(index)), Some(&color_to_hex(color)));
307307
}
308308

309-
// Use the selection threshold to check if the mouse is close enough to the gradient line to insert a new stop
310309
let distance = (end - start).angle_to(mouse - start).sin() * (mouse - start).length();
311310
let projection = ((end - start).angle_to(mouse - start)).cos() * start.distance(mouse) / start.distance(end);
312311

313312
if distance.abs() < SELECTION_THRESHOLD * 3. && (0. ..=1.).contains(&projection) {
314313
let mut near_stop = false;
315-
// Check if the mouse is close to an existing stop
316314
for (position, _) in stops {
317315
let stop_pos = start.lerp(end, *position);
318316
if stop_pos.distance_squared(mouse) < (MANIPULATOR_GROUP_MARKER_SIZE * 2.).powi(2) {
319317
near_stop = true;
320318
break;
321319
}
322320
}
323-
// Check if close to start or end
324321
if start.distance_squared(mouse) < (MANIPULATOR_GROUP_MARKER_SIZE * 2.).powi(2) || end.distance_squared(mouse) < (MANIPULATOR_GROUP_MARKER_SIZE * 2.).powi(2) {
325322
near_stop = true;
326323
}

0 commit comments

Comments
 (0)