Fix editor text caret measurement

This commit is contained in:
2026-04-23 01:43:23 +08:00
parent 82c39e2521
commit 514dee10cc
24 changed files with 205 additions and 62 deletions

View File

@@ -85,6 +85,11 @@ void HierarchyPanel::SetBuiltInIcons(const BuiltInIcons* icons) {
RebuildItems();
}
void HierarchyPanel::SetTextMeasurer(
const ::XCEngine::UI::Editor::UIEditorTextMeasurer* textMeasurer) {
m_textMeasurer = textMeasurer;
}
void HierarchyPanel::ResetInteractionState() {
m_filterHostState = {};
m_filterHostFrame = {};
@@ -660,7 +665,11 @@ void HierarchyPanel::Append(UIDrawList& drawList) const {
AppendUIEditorFilterableTreeHostSearchField(
drawList,
m_filterHostFrame,
m_filterHostState);
m_filterHostState,
"Search",
{},
{},
m_textMeasurer);
if (m_treeFrame.layout.bounds.width <= 0.0f ||
m_treeFrame.layout.bounds.height <= 0.0f) {
return;
@@ -687,7 +696,8 @@ void HierarchyPanel::Append(UIDrawList& drawList) const {
m_renameState,
ResolveUIEditorTreeViewInlineRenamePalette(),
BuildUIEditorTreeViewInlineRenameMetrics(
BuildRenameBounds(m_renameState.itemId, m_treeFrame.layout)));
BuildRenameBounds(m_renameState.itemId, m_treeFrame.layout)),
m_textMeasurer);
}
AppendUIEditorTreeViewDropPreview(