mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5868 from dumganhar/iss4447
closed #4447: [Desktop] Can't receive touchEnded event when mouse up outside of window
This commit is contained in:
commit
7ad17e1e69
|
@ -529,9 +529,9 @@ void GLView::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int
|
|||
}
|
||||
else if(GLFW_RELEASE == action)
|
||||
{
|
||||
_captured = false;
|
||||
if (this->getViewPortRect().equals(Rect::ZERO) || this->getViewPortRect().containsPoint(Point(_mouseX,_mouseY)))
|
||||
if (_captured)
|
||||
{
|
||||
_captured = false;
|
||||
int id = 0;
|
||||
this->handleTouchesEnd(1, &id, &_mouseX, &_mouseY);
|
||||
}
|
||||
|
@ -575,11 +575,8 @@ void GLView::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y)
|
|||
|
||||
if (_captured)
|
||||
{
|
||||
if (this->getViewPortRect().equals(Rect::ZERO) || this->getViewPortRect().containsPoint(Point(_mouseX, _mouseY)))
|
||||
{
|
||||
int id = 0;
|
||||
this->handleTouchesMove(1, &id, &_mouseX, &_mouseY);
|
||||
}
|
||||
int id = 0;
|
||||
this->handleTouchesMove(1, &id, &_mouseX, &_mouseY);
|
||||
}
|
||||
|
||||
EventMouse event(EventMouse::MouseEventType::MOUSE_MOVE);
|
||||
|
|
Loading…
Reference in New Issue