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

◆ handle_release()

void MayaFlux::Portal::Forma::Context::handle_release ( double  px,
double  py,
IO::MouseButtons  btn 
)
private

Definition at line 414 of file Context.cpp.

415{
416 const int btn_idx = static_cast<int>(btn);
417 m_dragging[btn_idx] = std::nullopt;
418
419 const glm::vec2 ndc = to_ndc(px, py);
420 const auto hit = m_layer->hit_test(ndc);
421 if (!hit)
422 return;
423
424 auto it = m_callbacks.find(*hit);
425 if (it == m_callbacks.end())
426 return;
427
428 auto btn_it = it->second.release.find(static_cast<int>(btn));
429 if (btn_it != it->second.release.end() && btn_it->second)
430 btn_it->second(*hit, ndc);
431}
uint32_t py
uint32_t px
std::optional< uint32_t > m_dragging[3]
Definition Context.hpp:382
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

References m_callbacks, m_dragging, m_layer, px, py, and to_ndc().

Referenced by register_handlers().

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