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

◆ handle_move()

void MayaFlux::Portal::Forma::Context::handle_move ( double  px,
double  py 
)
private

Definition at line 352 of file Context.cpp.

353{
354 sync_size();
355 const glm::vec2 ndc = to_ndc(px, py);
356 const auto hit = m_layer->hit_test(ndc);
357
358 if (hit != m_hovered) {
359 if (m_hovered) {
360 auto it = m_callbacks.find(*m_hovered);
361 if (it != m_callbacks.end() && it->second.leave)
362 it->second.leave(*m_hovered);
363 }
364 if (hit) {
365 auto it = m_callbacks.find(*hit);
366 if (it != m_callbacks.end() && it->second.enter)
367 it->second.enter(*hit);
368 }
369 m_hovered = hit;
370 }
371
372 if (hit) {
373 auto it = m_callbacks.find(*hit);
374 if (it != m_callbacks.end() && it->second.move)
375 it->second.move(*hit, ndc);
376 }
377}
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< Layer > m_layer
Definition Context.hpp:355
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_layer, 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: