Первые попытки рисовать

This commit is contained in:
2026-02-24 20:51:40 +03:00
parent 4f386c981c
commit ef768e9fe7
4 changed files with 127 additions and 12 deletions

View File

@@ -112,13 +112,18 @@ pub fn leftPanel(ctx: *WindowContext) void {
if (active_doc) |doc| {
const canvas = &doc.canvas;
if (dvui.checkbox(@src(), &canvas.native_scaling, "Scaling", .{})) {}
if (dvui.button(@src(), if (doc.cpu_render.type == .Gradient) "Gradient" else "Squares", .{}, .{})) {
if (doc.cpu_render.type == .Gradient) {
doc.cpu_render.type = .Squares;
} else {
doc.cpu_render.type = .Gradient;
if (dvui.checkbox(@src(), &canvas.draw_document, "Draw document", .{})) {
canvas.requestRedraw();
}
if (!canvas.draw_document) {
if (dvui.button(@src(), if (doc.cpu_render.type == .Gradient) "Gradient" else "Squares", .{}, .{})) {
if (doc.cpu_render.type == .Gradient) {
doc.cpu_render.type = .Squares;
} else {
doc.cpu_render.type = .Gradient;
}
canvas.requestRedraw();
}
canvas.redrawExample() catch {};
}
} else {
dvui.label(@src(), "No document", .{}, .{});