Skip to content

fix : Auto-Tangents node with spread = 0 and preserve existing = true causes weird change#3823

Draft
Annonnymmousss wants to merge 1 commit intoGraphiteEditor:masterfrom
Annonnymmousss:fix/auto_tan_bug
Draft

fix : Auto-Tangents node with spread = 0 and preserve existing = true causes weird change#3823
Annonnymmousss wants to merge 1 commit intoGraphiteEditor:masterfrom
Annonnymmousss:fix/auto_tan_bug

Conversation

@Annonnymmousss
Copy link
Contributor

@Annonnymmousss Annonnymmousss commented Feb 24, 2026

closes #3822

Screen.Recording.2026-02-24.at.9.54.03.PM.mov

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Annonnymmousss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a specific bug within the Auto-Tangents node's functionality. The change ensures that when the spread parameter is zero and existing tangents are meant to be preserved, the node correctly passes through the original data without unintended alterations. This improves the predictability and correctness of vector manipulation operations under these specific conditions.

Highlights

  • Bug Fix: Addressed an issue in the auto_tangents node where setting spread to 0 and preserve_existing to true would lead to an unexpected modification of the input source.
  • Conditional Logic: Implemented a new conditional check at the beginning of the auto_tangents function to immediately return the original source if spread is 0 and preserve_existing is true, thus preventing further processing.
Changelog
  • node-graph/nodes/vector/src/vector_nodes.rs
    • Fixed a bug in the auto_tangents function where spread = 0 and preserve_existing = true caused an incorrect change to the source data.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request addresses an issue where the Auto-Tangents node produced unexpected results when spread was 0 and preserve_existing was true. The proposed change introduces an early return for this specific combination of parameters. However, this early return alters the intended behavior for points with zero-length handles, preventing them from being correctly converted to sharp corners.

Comment on lines +877 to +878
if spread == 0. && preserve_existing {
return source;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The added if statement introduces a functional change that deviates from the expected behavior of spread = 0. (sharp corner) when preserve_existing is true.

If spread is 0. and preserve_existing is true, the existing logic (lines 911-929) correctly handles two scenarios:

  1. Points with non-zero existing handles are preserved (due to preserve_existing).
  2. Points with zero-length existing handles (i.e., handles at the anchor position) are explicitly set to None (due to spread = 0.), making them sharp corners.

The current early return return source; prevents scenario 2 from occurring. This means if a point has a handle that is exactly at its anchor position, it will not be removed, which contradicts the "sharp corner" definition of spread = 0..

To maintain the correct behavior, this early return should be removed, allowing the subsequent logic to process all points as intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

@Annonnymmousss Annonnymmousss marked this pull request as draft February 24, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-Tangents node with spread = 0 and preserve existing = true causes weird change

1 participant