Skip to content

Comments

Path tool box selection creates small square upon mousedown when animation is playing#3814

Open
Annonnymmousss wants to merge 1 commit intoGraphiteEditor:masterfrom
Annonnymmousss:fix/path_tool-anim
Open

Path tool box selection creates small square upon mousedown when animation is playing#3814
Annonnymmousss wants to merge 1 commit intoGraphiteEditor:masterfrom
Annonnymmousss:fix/path_tool-anim

Conversation

@Annonnymmousss
Copy link
Contributor

@Annonnymmousss Annonnymmousss commented Feb 23, 2026

closes #2595

Screen.Recording.2026-02-23.at.11.08.04.PM.mov

@gemini-code-assist
Copy link

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 addresses a bug in the path tool where an unintended small selection box would be created if the mouse was clicked and held without any movement. The fix ensures that a selection operation is only initiated if the mouse has moved a detectable distance from the initial drag start position, preventing the creation of these unwanted tiny selections.

Highlights

  • Path Tool Selection Fix: Resolved an issue where the path tool would create a tiny selection box upon mousedown if the mouse did not move, especially when animations were playing.
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

@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

This pull request fixes an issue where a small selection square would appear on mousedown when an animation is playing. The change correctly prevents the drawing of the selection overlay if the mouse has not moved from its starting position. The logic is sound and directly addresses the reported bug. I have one minor suggestion to improve code clarity by replacing a magic number with a named constant.

}
Self::Drawing { selection_shape } => {
let previous_mouse = document.metadata().document_to_viewport.transform_point2(tool_data.previous_mouse_position);
if tool_data.drag_start_pos.distance(previous_mouse) < 1e-8 {

Choose a reason for hiding this comment

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

medium

The magic number 1e-8 is used for checking if the drag distance is effectively zero. It would be better to define this as a named constant to improve readability and maintainability, for example ZERO_DRAG_DISTANCE_EPSILON. This would also allow for consistent usage, as a similar check exists elsewhere in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not required.

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.

Path tool box selection creates small square upon mousedown when animation is playing

1 participant