| 1138 | } |
| 1139 | |
| 1140 | void RenderViewImpl::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) |
| 1141 | { |
| 1142 | _mouseX = (float)x; |
| 1143 | _mouseY = (float)y; |
| 1144 | |
| 1145 | _mouseX /= this->getFrameZoomFactor(); |
| 1146 | _mouseY /= this->getFrameZoomFactor(); |
| 1147 | |
| 1148 | if (_isInRetinaMonitor) |
| 1149 | { |
| 1150 | if (_retinaFactor == 1) |
| 1151 | { |
| 1152 | _mouseX *= 2; |
| 1153 | _mouseY *= 2; |
| 1154 | } |
| 1155 | } |
| 1156 | if (!_isTouchDevice) |
| 1157 | { |
| 1158 | if (_captured) |
| 1159 | { |
| 1160 | intptr_t id = 0; |
| 1161 | this->handleTouchesMove(1, &id, &_mouseX, &_mouseY); |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | float cursorX = transformInputX(_mouseX); |
| 1166 | float cursorY = transformInputY(_mouseY); |
| 1167 | |
| 1168 | EventMouse event(EventMouse::MouseEventType::MOUSE_MOVE); |
| 1169 | // Set current button |
| 1170 | EventMouse::MouseButton mouseButton{EventMouse::MouseButton::BUTTON_UNSET}; |
| 1171 | event.setMouseInfo(cursorX, cursorY, checkMouseButton(window)); |
| 1172 | Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); |
| 1173 | } |
| 1174 | |
| 1175 | #if defined(__EMSCRIPTEN__) |
| 1176 | void RenderViewImpl::onWebTouchCallback(int eventType, const EmscriptenTouchEvent* touchEvent) |
no test coverage detected