MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ handle_scroll()

void MayaFlux::Portal::Forma::Context::handle_scroll ( double  dx,
double  dy 
)
private

Definition at line 460 of file Context.cpp.

461{
462 sync_size();
463 if (!m_hovered)
464 return;
465
466 auto it = m_callbacks.find(*m_hovered);
467 if (it == m_callbacks.end() || !it->second.scroll)
468 return;
469
470 const auto [px, py] = m_window->get_event_source().get_mouse_position();
471 it->second.scroll(*m_hovered, to_ndc(px, py), dx, dy);
472}
uint32_t py
uint32_t px
void sync_size()
Run the resize callbacks if the window's size differs from the size they last saw.
Definition Context.cpp:537
std::shared_ptr< Core::Window > m_window
Definition Context.hpp:356
glm::vec2 to_ndc(double px, double py) const noexcept
Definition Context.cpp:338
std::unordered_map< uint32_t, ElementCallbacks > m_callbacks
Definition Context.hpp:361
std::optional< uint32_t > m_hovered
Definition Context.hpp:359

References m_callbacks, m_hovered, m_window, px, py, sync_size(), and to_ndc().

Referenced by register_handlers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: