19 [
id](
const Element& e) {
return e.
id == id; });
38 if (
auto* el =
get(
id)) {
39 el->bounds_hint = bounds;
47 if (
auto* el =
get(
id)) {
56 if (
auto* el =
get(
id)) {
57 el->interactive = interactive;
69 root->visible = visible;
71 root->buffer->mark_for_processing(visible);
74 for (uint32_t rel_id : it->second)
83 for (uint32_t rel_id : rit->second) {
85 [rel_id](
const Element& e) {
return e.
id == rel_id; });
91 [
id](
const Element& e) {
return e.
id == id; });
101 for (uint32_t rel_id : rit->second)
106 [
id](
const Element& e) {
return e.
id == id; });
119 for (
const auto& m_element : std::views::reverse(
m_elements)) {
128 std::vector<uint32_t> result;
129 for (
const auto& m_element : std::views::reverse(
m_elements)) {
131 result.push_back(m_element.id);
137 double px,
double py, uint32_t win_w, uint32_t win_h)
const
143 double px,
double py, uint32_t win_w, uint32_t win_h)
const
154 auto* p =
get(primary_id);
155 auto* r =
get(related_id);
156 if (!p || !r || primary_id == related_id)
160 if (std::ranges::find(rel, related_id) == rel.end())
161 rel.push_back(related_id);
163 r->visible = p->visible;
165 r->buffer->mark_for_processing(p->visible);
175 auto& rel = it->second;
176 auto rit = std::ranges::find(rel, related_id);
177 if (rit == rel.end())
188 return it !=
m_relations.end() ? it->second : std::vector<uint32_t> {};
198 [
id](
const Element& e) {
return e.
id == id; });
199 return it !=
m_elements.end() ? &*it :
nullptr;
205 [
id](
const Element& e) {
return e.
id == id; });
206 return it !=
m_elements.end() ? &*it :
nullptr;
216 return { ndc3.x, ndc3.y };
221 if (!el.interactive || !el.visible)
223 if (el.bounds_hint && !el.bounds_hint->contains(ndc))
226 return el.contains(ndc);
227 return el.bounds_hint.has_value();
glm::vec3 to_ndc(double window_x, double window_y, uint32_t width, uint32_t height)
Convert window pixel coordinates to NDC.
bool contains(glm::vec2 p) const noexcept
Axis-aligned bounding rectangle in a 2D coordinate space.