| 214 | } |
| 215 | |
| 216 | bool dispatchScrollToModals(double xoff, double yoff, double x, double y, |
| 217 | [[maybe_unused]] int mods, const bool over_gui) { |
| 218 | op::ModalEvent evt{}; |
| 219 | evt.type = op::ModalEvent::Type::MOUSE_SCROLL; |
| 220 | evt.data = MouseScrollEvent{xoff, yoff}; |
| 221 | |
| 222 | if (op::operators().hasModalOperator()) { |
| 223 | const auto result = op::operators().dispatchModalEvent(evt); |
| 224 | if (result != op::OperatorResult::PASS_THROUGH) { |
| 225 | return true; |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | python::ModalEvent py_evt{}; |
| 230 | py_evt.type = python::ModalEvent::Type::Scroll; |
| 231 | py_evt.scroll_x = xoff; |
| 232 | py_evt.scroll_y = yoff; |
| 233 | py_evt.x = x; |
| 234 | py_evt.y = y; |
| 235 | py_evt.over_gui = over_gui; |
| 236 | |
| 237 | return python::dispatch_modal_event(py_evt); |
| 238 | } |
| 239 | |
| 240 | std::optional<ToolType> ownerToolForActivationAction(const input::Action action) { |
| 241 | switch (action) { |
no test coverage detected