From 281884e9b01bfa6e70c36b2ea101863c6b17a3b0 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 1 Dec 2024 12:25:37 -0700 Subject: [PATCH] examples: core-triangle: cleanup width/height input handler Signed-off-by: Stephen Gutekanst --- examples/core-triangle/App.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/core-triangle/App.zig b/examples/core-triangle/App.zig index 9523da6a..00156e09 100644 --- a/examples/core-triangle/App.zig +++ b/examples/core-triangle/App.zig @@ -75,14 +75,10 @@ pub fn tick(app: *App, core: *mach.Core) void { .key_press => |ev| { switch (ev.key) { .right => { - var w = core.windows.getValue(core.main_window); - w.width = w.width + 10; - core.windows.setValue(core.main_window, w); + core.windows.set(core.main_window, .width, core.windows.get(core.main_window, .width) + 10); }, .left => { - var w = core.windows.getValue(core.main_window); - w.width = w.width - 10; - core.windows.setValue(core.main_window, w); + core.windows.set(core.main_window, .width, core.windows.get(core.main_window, .width) - 10); }, .up => { core.windows.set(core.main_window, .height, core.windows.get(core.main_window, .height) + 10);