Skip to content

Extending from point allows a handle to be colinear with 2 others #4618

Open

Description

@0HyperCube

Reproduction

  • New document
  • Use pen tool
  • Draw path containing an anchor with colinear handles (not an end point and not broken)
  • Extend from the anchor with colinear handles by clicking (do not drag)
  • Finish the path
  • Use path tool
  • Drag the handle noting how the handle tries to be colinear with two different handles causing strange behaviour.

Video

colinear_twice.mp4

Resolution

When extending from an existing point that is already connected to two segments, do not make it colinear with the existing path. If the user does not drag to place the handle then it should probably be placed on top of the anchor. When there is only one segment connected to a point, it may be desirable (?) to keep the current behaviour.

Relevant code

/// Perform extension of an existing path
fn extend_existing_path(&mut self, document: &DocumentMessageHandler, layer: LayerNodeIdentifier, point: PointId, position: DVec2) {
let vector = document.network_interface.compute_modified_vector(layer);
let (handle_start, in_segment) = if let Some(vector) = &vector {
vector

if let Some(h1) = handles[0].to_manipulator_point().get_position(&vector) {
let angle = (h1 - last_point.pos).angle_to(last_point.handle_start - last_point.pos);
let pi = std::f64::consts::PI;
let colinear = (angle - pi).abs() < 1e-6 || (angle + pi).abs() < 1e-6;
responses.add(GraphOperationMessage::Vector {
layer,
modification_type: VectorModificationType::SetG1Continuous { handles, enabled: colinear },
});
}

Activity

  1. parthdude07 commented on Sep 29, 2026

    @parthdude07

    @0HyperCube I want to solve this issue.

  2. 0HyperCube commented on Sep 29, 2026

    @0HyperCube
    ContributorAuthor

    Hi @parthdude07. You are welcome to attempt any issue you wish. Please see the contributor guide for more information. Note issues are not assigned to new contributors until they open a draft PR to avoid ghost assignments.

  3. added 2 commits that reference this issue on Oct 14, 2026
    c30dde6
    e8356e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions