Возможность добавлять объекты в документ
This commit is contained in:
@@ -8,7 +8,6 @@ const defaultCommonProperties = @import("Property.zig").defaultCommonProperties;
|
||||
const Object = @This();
|
||||
|
||||
pub const ShapeKind = enum {
|
||||
rect,
|
||||
line,
|
||||
ellipse,
|
||||
arc,
|
||||
@@ -81,13 +80,6 @@ fn createWithCommonProperties(allocator: std.mem.Allocator, shape: ShapeKind) !O
|
||||
};
|
||||
}
|
||||
|
||||
pub fn createRect(allocator: std.mem.Allocator) !Object {
|
||||
var obj = try createWithCommonProperties(allocator, .rect);
|
||||
errdefer obj.deinit(allocator);
|
||||
try obj.properties.append(allocator, .{ .data = .{ .size = .{ .width = 100, .height = 100 } } });
|
||||
return obj;
|
||||
}
|
||||
|
||||
pub fn createEllipse(allocator: std.mem.Allocator) !Object {
|
||||
var obj = try createWithCommonProperties(allocator, .ellipse);
|
||||
errdefer obj.deinit(allocator);
|
||||
|
||||
Reference in New Issue
Block a user