MayaFlux 0.4.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 263 of file Context.cpp.

264{
265 const glm::vec2 ndc = to_ndc(px, py);
266 const auto hit = m_layer->hit_test(ndc);
267
268 if (hit != m_hovered) {
269 if (m_hovered) {
270 auto it = m_callbacks.find(*m_hovered);
271 if (it != m_callbacks.end() && it->second.leave)
272 it->second.leave(*m_hovered);
273 }
274 if (hit) {
275 auto it = m_callbacks.find(*hit);
276 if (it != m_callbacks.end() && it->second.enter)
277 it->second.enter(*hit);
278 }
279 m_hovered = hit;
280 }
281
282 if (hit) {
283 auto it = m_callbacks.find(*hit);
284 if (it != m_callbacks.end() && it->second.move)
285 it->second.move(*hit, ndc);
286 }
287}
std::shared_ptr< Layer > m_layer
Definition Context.hpp:246
glm::vec2 to_ndc(double px, double py) const noexcept
Definition Context.cpp:254
std::unordered_map< uint32_t, ElementCallbacks > m_callbacks
Definition Context.hpp:252
std::optional< uint32_t > m_hovered
Definition Context.hpp:250

References m_callbacks, m_hovered, m_layer, and to_ndc().

Referenced by register_handlers().

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