Рефакторинг ещё...

This commit is contained in:
2026-02-24 23:52:13 +03:00
parent e5dd455d14
commit 1d995995e7
7 changed files with 156 additions and 74 deletions

View File

@@ -3,6 +3,7 @@ const Canvas = @import("Canvas.zig");
const CpuRenderEngine = @import("render/CpuRenderEngine.zig");
const RenderEngine = @import("render/RenderEngine.zig").RenderEngine;
const Document = @import("models/Document.zig");
const random_document = @import("models/random_document.zig");
const basic_models = @import("models/basic_models.zig");
const WindowContext = @This();
@@ -60,7 +61,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 random_document.addRandomShapes(&ptr.document, std.crypto.random);
try self.documents.append(self.allocator, ptr);
self.active_document_index = self.documents.items.len - 1;
}