Skip to content

Conversation

@zeusongit
Copy link
Contributor

@zeusongit zeusongit commented Oct 1, 2025

Purpose

Updated the mouse release event handler to check for the middle mouse button specifically when toggling pan mode, ensuring correct behavior when releasing the middle mouse button. This was conflicting with the PanMode state

Cases:

User switches to PanMode
Cursor changes to Hand and stays in this mode until either the user switches off the PanMode or uses the mouse middle button to pan.

User uses mouse middle button to pan:
Cursor changes to Hand for the duration while the mouse middle button is pressed, and switches back to normal when released.

User is panning while in between connecting ports:
Cursor changes to connect mode until the connection is dropped or completed.

When in PanMode clicking on ports won't initiate connection mode.

Declarations

Check these if you believe they are true

Release Notes

Fix pan tool to remain active until the user choose to deactivate it

Reviewers

Updated the mouse release event handler to check for the middle mouse button specifically when toggling pan mode, ensuring correct behavior when releasing the middle mouse button.
A comment was added to explain that pan mode is toggled only when not connecting a port and when panning with the middle mouse button. This improves code readability and maintainability.
@zeusongit zeusongit requested review from a team and Copilot October 1, 2025 14:46
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9616

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a regression where the pan tool would deactivate unintentionally when other mouse buttons were released. The fix ensures that pan mode is only toggled when specifically releasing the middle mouse button that initiated the panning operation.

  • Modified the mouse release event handler to check for the specific middle mouse button release
  • Changed from checking e.MiddleButton == MouseButtonState.Released to e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Released
  • Added a clarifying comment explaining the condition

Copy link
Member

@johnpierson johnpierson left a comment

Choose a reason for hiding this comment

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

tested locally and lgtm!

@zeusongit zeusongit merged commit 9c64009 into DynamoDS:master Oct 1, 2025
30 checks passed
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.

2 participants