From 05284c45a69a9d25f8053af0bfd0f6531a64a352 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 16 Jul 2021 22:51:20 +0300 Subject: [PATCH] examples: fix x,y dimensions --- examples/gg/random.v | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gg/random.v b/examples/gg/random.v index b706038d7f..55304c8f94 100644 --- a/examples/gg/random.v +++ b/examples/gg/random.v @@ -11,17 +11,17 @@ struct AppState { mut: gg &gg.Context = 0 istream_idx int - pixels [pwidth][pheight]u32 + pixels [pheight][pwidth]u32 } [direct_array_access] fn (mut state AppState) update() { mut rcolor := u64(state.gg.frame) for { - for x in 0 .. pwidth { - for y in 0 .. pheight { + for y in 0 .. pheight { + for x in 0 .. pwidth { rcolor = rcolor * 1664525 + 1013904223 - state.pixels[x][y] = u32(rcolor & 0x0000_0000_FFFF_FFFF) | 0x1010AFFF + state.pixels[y][x] = u32(rcolor & 0x0000_0000_FFFF_FFFF) | 0x1010AFFF } } time.sleep(33 * time.millisecond)