Skip to content

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

@Canop

Description

@Canop

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions