Skip to content

fix: enabling snapline plugin selecting and moving cells bug #4493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wqgs2004214
Copy link

…translateby是node2时,导致node2和组合在一起的node3移动错乱,并且node1移动错误的bug

Description

fix #4491

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Enhancement (changes that improvement of current feature or performance)
  • Refactoring (changes that neither fixes a bug nor adds a feature)
  • Test Case (changes that add missing tests or correct existing tests)
  • Code style optimization (changes that do not affect the meaning of the code)
  • Docs (changes that only update documentation)
  • Chore (changes that don't modify src or test files)

Self Check before Merge

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…translateby是node2时,导致node2和组合在一起的node3移动错乱,并且node1移动错误的bug
@@ -573,7 +573,11 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
if (otherOptions && otherOptions.translateBy) {
const currentCell = this.graph.getCellById(otherOptions.translateBy)
if (currentCell) {
map[currentCell.id] = true
// 问题:开启snapline后,当我们框选圆形组件、node2矩形组件(node2中有一个node3被embedding时),translateby是node2时,导致node2和组合在一起的node3移动错乱,并且node1移动错误的bug
Copy link
Member

@hustcc hustcc Aug 12, 2025

Choose a reason for hiding this comment

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

map[currentCell.id] = true

@wqgs2004214 这行代码知道是用来干啥的嘛?一定是特意需要这么做的,直接删了会带其他更多的问题吧?

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.

开启snapline后,框选移动BUG
2 participants