yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dock_tree_hit_test.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_LAYOUT_LAYOUT_DESIGNER_DOCK_TREE_HIT_TEST_H_
2#define YAZE_APP_EDITOR_LAYOUT_LAYOUT_DESIGNER_DOCK_TREE_HIT_TEST_H_
3
6#include "imgui/imgui.h"
7
8namespace yaze {
9namespace editor {
10namespace layout_designer {
11
12// Returns the deepest node drawn at `mouse`, or nullptr when `mouse` is
13// outside the laid-out viewport. "Deepest drawn" matches the renderer's
14// cell-or-collapsed-split semantics: leaves and collapsed splits are
15// terminal, expanded splits are transparent to the hit test.
16//
17// Implemented as min-area over the layout map — `ComputeLayout` records
18// ancestor rects that strictly contain their descendants, so the smallest
19// rect containing `mouse` is the deepest drawn cell. Pure geometry; no
20// ImGui context required.
21const DockNode* HitTestNode(const DockTreeLayout& layout, ImVec2 mouse);
22
23} // namespace layout_designer
24} // namespace editor
25} // namespace yaze
26
27#endif // YAZE_APP_EDITOR_LAYOUT_LAYOUT_DESIGNER_DOCK_TREE_HIT_TEST_H_
const DockNode * HitTestNode(const DockTreeLayout &layout, ImVec2 mouse)