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

◆ bring_to_front()

bool MayaFlux::Portal::Forma::Layer::bring_to_front ( uint32_t  id)

Move element to the top of the hit-test order (drawn last).

Definition at line 80 of file Layer.cpp.

81{
82 if (auto rit = m_relations.find(id); rit != m_relations.end()) {
83 for (uint32_t rel_id : rit->second) {
84 auto it = std::ranges::find_if(m_elements,
85 [rel_id](const Element& e) { return e.id == rel_id; });
86 if (it != m_elements.end())
87 std::rotate(it, it + 1, m_elements.end());
88 }
89 }
90 auto it = std::ranges::find_if(m_elements,
91 [id](const Element& e) { return e.id == id; });
92 if (it == m_elements.end())
93 return false;
94 std::rotate(it, it + 1, m_elements.end());
95 return true;
96}
std::vector< Element > m_elements
Definition Layer.hpp:280
std::unordered_map< uint32_t, std::vector< uint32_t > > m_relations
Definition Layer.hpp:283

References MayaFlux::Portal::Forma::Element::id, m_elements, and m_relations.