Refactor new editor boundaries and test ownership

This commit is contained in:
2026-04-19 15:52:28 +08:00
parent dc13b56cf3
commit 93f06e84ed
279 changed files with 6349 additions and 3238 deletions

View File

@@ -488,16 +488,17 @@ UIEditorHostCommandDispatchResult HierarchyPanel::DispatchEditCommand(
void HierarchyPanel::ProcessDragAndFrameEvents(
const std::vector<UIInputEvent>& inputEvents,
const UIRect& bounds,
bool allowInteraction,
bool panelActive) {
const std::vector<UIInputEvent> filteredEvents = FilterUIEditorTreePanelInputEvents(
const PanelInputContext& inputContext) {
const std::vector<UIInputEvent> filteredEvents = BuildUIEditorTreePanelInputEvents(
bounds,
inputEvents,
UIEditorTreePanelInputFilterOptions{
.allowInteraction = allowInteraction,
.panelActive = panelActive,
.allowInteraction = inputContext.allowInteraction,
.hasInputFocus = inputContext.hasInputFocus,
.captureActive = HasActivePointerCapture()
});
},
inputContext.focusGained,
inputContext.focusLost);
if (m_treeFrame.result.selectionChanged) {
SyncSceneRuntimeSelectionFromTree();
@@ -570,8 +571,7 @@ void HierarchyPanel::ProcessDragAndFrameEvents(
void HierarchyPanel::Update(
const UIEditorPanelContentHostFrame& contentHostFrame,
const std::vector<UIInputEvent>& inputEvents,
bool allowInteraction,
bool panelActive) {
const PanelInputContext& inputContext) {
ResetTransientState();
const UIEditorPanelContentHostPanelState* panelState =
@@ -593,16 +593,18 @@ void HierarchyPanel::Update(
}
m_visible = true;
const std::vector<UIInputEvent> filteredEvents = FilterUIEditorTreePanelInputEvents(
const std::vector<UIInputEvent> filteredEvents = BuildUIEditorTreePanelInputEvents(
panelState->bounds,
inputEvents,
UIEditorTreePanelInputFilterOptions{
.allowInteraction = allowInteraction,
.panelActive = panelActive,
.allowInteraction = inputContext.allowInteraction,
.hasInputFocus = inputContext.hasInputFocus,
.captureActive = HasActivePointerCapture()
});
},
inputContext.focusGained,
inputContext.focusLost);
SyncTreeFocusState(filteredEvents);
ClaimCommandFocus(filteredEvents, panelState->bounds, allowInteraction);
ClaimCommandFocus(filteredEvents, panelState->bounds, inputContext.allowInteraction);
const Widgets::UIEditorTreeViewMetrics treeMetrics =
ResolveUIEditorTreeViewMetrics();
@@ -648,8 +650,7 @@ void HierarchyPanel::Update(
ProcessDragAndFrameEvents(
inputEvents,
panelState->bounds,
allowInteraction,
panelActive);
inputContext);
}
void HierarchyPanel::Append(UIDrawList& drawList) const {