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

Click incorrectly handled if mouse moved while the window wasn't focused #375

Closed
Canop opened this issue Oct 10, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@Canop
Copy link

commented Oct 10, 2013

How to reproduce :

  1. open this official tutorial : http://www.createjs.com/tutorials/Mouse%20Interaction/basic.html
  2. click the red circle
  3. move slightly your mouse to leave the circle
  4. hit enter to close the dialog
  5. not moving the mouse, click again : you see the dialog opening again as if the mouse were on the circle

Why :

It's because of an optimization in stage.js where the mouse position isn't forwarded on click on the basis the computations are done on move.

How to fix :

One way would be to change the _handleMouseDown function like this :

_handleMouseDown = function(e) {
        this._handlePointerDown(-1, e, e.pageX, e.pageY);
};

The cost would be to do at each click the same computation that is done on each move. I don't personally think it's important.

Here's a demonstration of how this fix would behave : http://dystroy.org/stackoverflow/EaselJS_bug_moveUnfocused.html

Reference :

See http://stackoverflow.com/q/19246361/263525
(Canop == dystroy)

@gskinner

This comment has been minimized.

Copy link
Member

commented Oct 10, 2013

Good catch. I have incorporated this fix into the NEXT build and pushed an update. As you guessed, the performance impact is insignificant.

@gskinner gskinner closed this Oct 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.