кнопка для переключения сэмпла

This commit is contained in:
2025-12-21 19:27:45 +03:00
parent 070c8bad2d
commit e7a0c20353

View File

@@ -92,10 +92,18 @@ fn gui_frame(ctx: *WindowContext) bool {
canvas.exampleReset() catch |err| { canvas.exampleReset() catch |err| {
std.debug.print("Error filling canvas: {}\n", .{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()); //ctx.canvas.setZoom(dvui.windowNaturalScale());
} }
if (dvui.checkbox(@src(), &canvas.native_scaling, "Scaling", .{})) {} 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(); left_panel.deinit();