From 45027ec8b9e9e00887ce071d16575ae1a68eae2d Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Fri, 15 Sep 2023 10:31:34 -0400 Subject: [PATCH] put some spacing betwene tool status and toasts --- Program.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Program.cs b/Program.cs index 5351f82..24f1a67 100644 --- a/Program.cs +++ b/Program.cs @@ -88,7 +88,6 @@ public class Transform { public interface ITool { ToolStatus HandleInput(KeyboardState input, MouseState mouse, Transform transform, Game game, Photo photo, UiGeometry geometry); string Status(); - void Draw(UiGeometry geometry, Game game); } public class ViewTool : ITool { @@ -114,9 +113,6 @@ public class ViewTool : ITool { public string Status() { return ""; } - - public void Draw(UiGeometry geometry, Game game) { - } } @@ -252,9 +248,6 @@ public class CropTool : ITool { return (left, right, top, bottom); } - public void Draw(UiGeometry geometry, Game game) { - } - public string Status() { return "[crop] " + status; } @@ -292,9 +285,6 @@ public class StraightenTool : ITool { return ToolStatus.Active; } - public void Draw(UiGeometry geometry, Game game) { - } - public string Status() { return String.Format("[straighten] {0}", photo.Rotation); } @@ -958,8 +948,6 @@ public class Game : GameWindow { DrawText("No photos found.", 10, 10); } - activeTool.Draw(geometry, this); - SwapBuffers(); } @@ -1027,7 +1015,11 @@ public class Game : GameWindow { // Second line. y += 20; - DrawText(activeTool.Status() + toast.Get(), geometry.StatusBox.Min.X, y); + string status = activeTool.Status(); + if (status.Length != 0) { + status += " "; + } + DrawText(status + toast.Get(), geometry.StatusBox.Min.X, y); DrawText(String.Format("FPS: {0,2}", fpsCounter.Fps), geometry.StatusBox.Max.X - 66, y); if (activePhoto.Loaded) { DrawText($"{(scale * 100):F1}%", geometry.StatusBox.Max.X - 136, y);