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

324{
325 const int btn_idx = static_cast<int>(btn);
326 m_dragging[btn_idx] = std::nullopt;
327
328 const glm::vec2 ndc = to_ndc(px, py);
329 const auto hit = m_layer->hit_test(ndc);
330 if (!hit)
331 return;
332
333 auto it = m_callbacks.find(*hit);
334 if (it == m_callbacks.end())
335 return;
336
337 auto btn_it = it->second.release.find(static_cast<int>(btn));
338 if (btn_it != it->second.release.end() && btn_it->second)
339 btn_it->second(*hit, ndc);
340}
std::optional< uint32_t > m_dragging[3]
Definition Context.hpp:268
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

References m_callbacks, m_dragging, 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: