Skip to main content

build_tree_update

Function build_tree_update 

Source
pub fn build_tree_update(
    tree: &[(ElementId, SemanticsData)],
    focus: Option<ElementId>,
    dpr: f32,
    is_initial: bool,
) -> TreeUpdate
Expand description

把 build_accessibility_tree() 输出的语义快照转成 accesskit::TreeUpdate。

  • tree:core 产出的 Vec<(ElementId, SemanticsData)>
  • focus:当前焦点 ElementId(可能 None)
  • dpr:设备像素比 — bounds 从逻辑像素乘 DPR 转物理像素
  • is_initial:true 时包含 Tree 元信息(首次推树时必须提供)