From 5194fec400e930e5a5c70cd8d2af881f7dad5594 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sat, 8 Jul 2023 00:04:45 -0400 Subject: [PATCH] clean up TEXTURE_WHITE initialization & thumbnail geometry --- Program.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Program.cs b/Program.cs index 6f8113d..862f94b 100644 --- a/Program.cs +++ b/Program.cs @@ -198,10 +198,10 @@ public class UiGeometry { public UiGeometry(Vector2i windowSize) { WindowSize = windowSize; - int thumbnailHeight = 150; + int numThumbnails = 12; + int thumbnailHeight = WindowSize.Y / numThumbnails; int thumbnailWidth = (int) 1.0 * thumbnailHeight * activeCamera.Resolution.X / activeCamera.Resolution.Y; - int numBoxes = 10; // FIXME - for (int i = 0; i < numBoxes; i++) { + for (int i = 0; i < numThumbnails; i++) { Box2i box = Util.makeBox(WindowSize.X - thumbnailWidth, i * thumbnailHeight, thumbnailWidth, thumbnailHeight); ThumbnailBoxes.Add(box); } @@ -219,8 +219,7 @@ public static class Util { public class Game : GameWindow { public Game(GameWindowSettings gwSettings, NativeWindowSettings nwSettings) : base(gwSettings, nwSettings) { } - private static Image white1x1 = new(1, 1, new Rgba32(255, 255, 255)); - private static Texture TEXTURE_WHITE = new Texture(white1x1); + private static Texture TEXTURE_WHITE = new Texture(new Image(1, 1, new Rgba32(255, 255, 255))); UiGeometry geometry = new();