кнопка для переключения сэмпла
This commit is contained in:
10
src/main.zig
10
src/main.zig
@@ -92,10 +92,18 @@ fn gui_frame(ctx: *WindowContext) bool {
|
||||
canvas.exampleReset() catch |err| {
|
||||
std.debug.print("Error filling canvas: {}\n", .{err});
|
||||
};
|
||||
ctx.canvas.pos = .{ .x = 400, .y = 400 };
|
||||
canvas.pos = .{ .x = 400, .y = 400 };
|
||||
//ctx.canvas.setZoom(dvui.windowNaturalScale());
|
||||
}
|
||||
if (dvui.checkbox(@src(), &canvas.native_scaling, "Scaling", .{})) {}
|
||||
if (dvui.button(@src(), if (ctx.cpu_render.type == .Gradient) "Gradient" else "Squares", .{}, .{})) {
|
||||
if (ctx.cpu_render.type == .Gradient) {
|
||||
ctx.cpu_render.type = .Squares;
|
||||
} else {
|
||||
ctx.cpu_render.type = .Gradient;
|
||||
}
|
||||
canvas.redrawExample() catch {};
|
||||
}
|
||||
}
|
||||
left_panel.deinit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user