Случайное дерево объектов

This commit is contained in:
2026-02-24 00:39:40 +03:00
parent aeda3ee0d0
commit 1a94cc8bfd
6 changed files with 203 additions and 48 deletions

View File

@@ -60,6 +60,7 @@ pub fn addNewDocument(self: *WindowContext) !void {
const ptr = try self.allocator.create(OpenDocument);
errdefer self.allocator.destroy(ptr);
OpenDocument.init(self.allocator, ptr);
try ptr.document.addRandomShapes(std.crypto.random);
try self.documents.append(self.allocator, ptr);
self.active_document_index = self.documents.items.len - 1;
}