| 71 | } |
| 72 | |
| 73 | bool InputManager::injectMouseMove(int _absx, int _absy, int _absz) |
| 74 | { |
| 75 | // запоминаем позицию |
| 76 | mMousePosition.set(_absx, _absy); |
| 77 | |
| 78 | // вычисляем прирост по колеса |
| 79 | int relz = _absz - mOldAbsZ; |
| 80 | mOldAbsZ = _absz; |
| 81 | |
| 82 | // проверка на скролл |
| 83 | if (relz != 0) |
| 84 | { |
| 85 | bool isFocus = isFocusMouse(); |
| 86 | if (isFocusMouse()) |
| 87 | mWidgetMouseFocus->_riseMouseWheel(relz); |
| 88 | return isFocus; |
| 89 | } |
| 90 | |
| 91 | if (isCaptureMouse()) |
| 92 | { |
| 93 | bool isFocus = isFocusMouse(); |
| 94 | if (isFocus) |
| 95 | { |
| 96 | if (mLayerMouseFocus != nullptr) |
| 97 | { |
| 98 | IntPoint point = mLayerMouseFocus->getPosition(_absx, _absy); |
| 99 | for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i) |
| 100 | { |
| 101 | if (mMouseCapture[i]) |
| 102 | mWidgetMouseFocus->_riseMouseDrag(point.left, point.top, MouseButton::Enum(i)); |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return isFocus; |
| 108 | } |
| 109 | |
| 110 | Widget* old_mouse_focus = mWidgetMouseFocus; |
| 111 | |
| 112 | // ищем активное окно |
| 113 | Widget* item = LayerManager::getInstance().getWidgetFromPoint(_absx, _absy); |
| 114 | |
| 115 | // ничего не изменилось |
| 116 | if (mWidgetMouseFocus == item) |
| 117 | { |
| 118 | bool isFocus = isFocusMouse(); |
| 119 | if (isFocusMouse()) |
| 120 | { |
| 121 | if (mLayerMouseFocus != nullptr) |
| 122 | { |
| 123 | IntPoint point = mLayerMouseFocus->getPosition(_absx, _absy); |
| 124 | mWidgetMouseFocus->_riseMouseMove(point.left, point.top); |
| 125 | } |
| 126 | } |
| 127 | return isFocus; |
| 128 | } |
| 129 | |
| 130 | if (item) |
nothing calls this directly
no test coverage detected