рефакторинг небольшой
This commit is contained in:
@@ -8,7 +8,7 @@ const Rect_i = basic_models.Rect_i;
|
||||
const Size_i = basic_models.Size_i;
|
||||
const Point2_f = @import("models/basic_models.zig").Point2_f;
|
||||
const Color = dvui.Color;
|
||||
|
||||
const tools = @import("tools.zig");
|
||||
const Toolbar = @import("Toolbar.zig");
|
||||
const Canvas = @This();
|
||||
|
||||
@@ -29,15 +29,14 @@ _zoom: f32 = 1,
|
||||
_redraw_pending: bool = false,
|
||||
_last_redraw_time_ms: i64 = 0,
|
||||
cursor_document_point: ?Point2_f = null,
|
||||
/// true — рисовать документ (render), false — пример (gradient/squares).
|
||||
draw_document: bool = true,
|
||||
|
||||
pub fn init(allocator: std.mem.Allocator, document: *Document, engine: RenderEngine, toolbar: Toolbar) Canvas {
|
||||
pub fn init(allocator: std.mem.Allocator, document: *Document, engine: RenderEngine) Canvas {
|
||||
return .{
|
||||
.allocator = allocator,
|
||||
.document = document,
|
||||
.render_engine = engine,
|
||||
.toolbar = toolbar,
|
||||
.toolbar = Toolbar.init(&tools.default_tools),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user