diff --git a/src/main.zig b/src/main.zig index b86b9c6..0d2bb48 100644 --- a/src/main.zig +++ b/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();