Первые попытки рисовать
This commit is contained in:
@@ -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", .{}, .{});
|
||||
|
||||
Reference in New Issue
Block a user