bind is-split property between split_tree class and surface class

This commit is contained in:
rhodes-b
2025-09-21 20:35:20 -05:00
parent 3254bb41d5
commit fdcaeebb99
4 changed files with 66 additions and 37 deletions

View File

@@ -507,16 +507,12 @@ pub fn SplitTree(comptime V: type) type {
// We need to increase the reference count of all the nodes.
try refNodes(gpa, nodes);
const result: Self = .{
return .{
.arena = arena,
.nodes = nodes,
// Splitting always resets zoom state.
.zoomed = null,
};
result.updateNodesNumberSiblings();
return result;
}
/// Remove a node from the tree.
@@ -560,8 +556,6 @@ pub fn SplitTree(comptime V: type) type {
// Increase the reference count of all the nodes.
try refNodes(gpa, nodes);
result.updateNodesNumberSiblings();
return result;
}
@@ -871,14 +865,6 @@ pub fn SplitTree(comptime V: type) type {
};
}
/// Set the number of siblings for each split in the tree
fn updateNodesNumberSiblings(self: *const Self) void {
var it = self.iterator();
while (it.next()) |entry| {
entry.view.setNSiblings(self.nodes.len - 1);
}
}
/// Spatial representation of the split tree. See spatial.
pub const Spatial = struct {
/// The slots of the spatial representation in the same order