MCPcopy Create free account
hub / github.com/VitalAudio/visage / handleMouseWheel

Method handleMouseWheel

visage_app/window_event_handler.cpp:349–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347 }
348
349 void WindowEventHandler::handleMouseWheel(float delta_x, float delta_y, float precise_x,
350 float precise_y, int x, int y, int button_state,
351 int modifiers, bool momentum) {
352 MouseEvent mouse_event = mouseEvent(x, y, button_state, modifiers);
353 mouse_event.wheel_delta_x = delta_x;
354 mouse_event.wheel_delta_y = delta_y;
355 mouse_event.precise_wheel_delta_x = precise_x;
356 mouse_event.precise_wheel_delta_y = precise_y;
357 mouse_event.wheel_momentum = momentum;
358
359 mouse_hovered_frame_ = content_frame_->frameAtPoint(mouse_event.window_position);
360 if (mouse_hovered_frame_) {
361 temporary_frame_ = mouse_hovered_frame_;
362 bool used = false;
363
364 while (!used && temporary_frame_) {
365 while (temporary_frame_ && temporary_frame_->ignoresMouseEvents())
366 temporary_frame_ = temporary_frame_->parent();
367
368 if (temporary_frame_) {
369 mouse_event.position = mouse_event.window_position - temporary_frame_->positionInWindow();
370 used = temporary_frame_->processMouseWheel(mouse_event);
371 if (temporary_frame_)
372 temporary_frame_ = temporary_frame_->parent();
373 }
374 }
375 }
376 temporary_frame_ = nullptr;
377 }
378
379 bool WindowEventHandler::isDragDropSource() {
380 return mouse_down_frame_ != nullptr && mouse_down_frame_->isDragDropSource();

Callers

nothing calls this directly

Calls 5

frameAtPointMethod · 0.80
ignoresMouseEventsMethod · 0.80
positionInWindowMethod · 0.80
processMouseWheelMethod · 0.80
parentMethod · 0.45

Tested by

no test coverage detected