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

@@ -218,6 +218,7 @@ void InspectorPanel::ResetPanelState() {
m_visible = false;
m_bounds = {};
m_sceneRuntime = nullptr;
m_textMeasurer = nullptr;
m_subject = {};
m_subjectKey.clear();
m_presentation = {};
@@ -733,6 +734,7 @@ void InspectorPanel::Update(
m_visible = true;
m_bounds = dispatchEntry.bounds;
m_sceneRuntime = &context.GetSceneRuntime();
m_textMeasurer = context.GetShellServices().textMeasurer;
m_subject = BuildInspectorSubject(context.GetSession(), context.GetSceneRuntime());
const std::string nextSubjectKey = BuildSubjectKey();
@@ -894,7 +896,10 @@ void InspectorPanel::Append(UIDrawList& drawList) const {
m_interactionState.propertyGridState,
m_propertyEditModel,
::XCEngine::UI::Editor::GetUIEditorFixedPropertyGridPalette(),
::XCEngine::UI::Editor::GetUIEditorFixedPropertyGridMetrics());
::XCEngine::UI::Editor::GetUIEditorFixedPropertyGridMetrics(),
{},
{},
m_textMeasurer);
}
if (ShouldShowAddComponentButton()) {