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

cancelOnMove distance settings #1058

Merged
merged 4 commits into from
May 29, 2020

Conversation

BryonLewis
Copy link
Contributor

cancelOnMove was modified so that it would accept a non-negative number as a distance that the mouse can be moved while held down. With cancelOnMove being true by default it was difficult to do fast selection of multiple objects. This allows the objects to have some variance when a user is moving the mouse. That variance is specified by the cancelOnMove number.

The previous functionality of utilizing false and true should still work because all uses of cancelOnMove were truthy values. I had to add in an explicit value because mouse movements in pageX and pageY do support subpixel movements if the cancelOnMove number is less than 1 I couldn't do a basic compare of dist<cancelOnMove because a distance of less than 1 would result in false.
MDN PageX Doc

Only additional thing would be to handle negative numbers either by defaulting to false. They weren't handled or I believed check for before, but it is something I can add in if it is decided to be necessary.

BryonLewis and others added 2 commits May 26, 2020 16:54
This also updates the base images to handle changes in Chrome 83.
@manthey
Copy link
Contributor

manthey commented May 27, 2020

@BryonLewis CI is failing because of changes in Chrome 83. I've got a PR (#1059) that fixes that particular issue. Please rebase or merge from that branch.

Comment on lines 27 to 29
* @property {boolean|number} [click.cancelOnMove=true] If truthy, don't generate
* click events if the mouse moved at all. If a positive number, the distance
* at which to cancel click events when the mouse moves.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be changed to If `true`, don't ....

@manthey
Copy link
Contributor

manthey commented May 29, 2020

Aside from a small change needed in the jsdocs, this looks good. I don't think we need to have any code explicitly for negative numbers.

@BryonLewis BryonLewis marked this pull request as ready for review May 29, 2020 12:09
@manthey manthey merged commit 589ab07 into OpenGeoscience:master May 29, 2020
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