Skip to content
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

Update: findtarget supports selectionKey. #10364

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhe-he
Copy link
Contributor

@zhe-he zhe-he commented Dec 27, 2024

Previously, if the element found by findtarget was activeSelection, it would not continue searching. A new feature has been added: by pressing the Shift key, it can now continue to search for elements covered by activeSelection, enabling support for mouse:out and mouse:over events.

#10337

Copy link

codesandbox bot commented Dec 27, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

) {
return other;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this works 100% of the time? this._objects includes the object in the active selection i assume.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1.    else if (
        aObjects.length > 1 &&
        // check pointer is over active selection and possibly perform `subTargetCheck`
        this.searchPossibleTargets([activeObject], pointer)
      ) {
        // If you hold down selection key, you can select elements that are blocked by active selection.
        if (this._isSelectionKeyPressed(e)) {
          const other = this.searchPossibleTargets(this._objects, pointer);
          if (
            other &&
 2.           !(activeObject as ActiveSelection).contains(other, true)
          ) {
            return other;
          }
        }
        // active selection does not select sub targets like normal groups
3.        return activeObject;
      } 

This is the full text.
At point 1, it can be confirmed that it is definitely the activeSelection.
At point 2, if we assume that this._objects includes the activeSelection and other is the activeSelection, the result returned will be the same as at point 3.

Copy link
Member

Choose a reason for hiding this comment

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

I'll try to reproduce on canvas the case i think may fail

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