|
|
@ -265,6 +265,10 @@ public class StraightenTool : ITool { |
|
|
|
} |
|
|
|
|
|
|
|
public ToolStatus HandleInput(KeyboardState input, MouseState mouse, Transform transform, Game game, Photo photo, UiGeometry geometry) { |
|
|
|
if (input.IsKeyPressed(Keys.D0)) { |
|
|
|
photo.RotationDegrees = 0; |
|
|
|
} |
|
|
|
|
|
|
|
if (input.IsKeyPressed(Keys.Left)) { |
|
|
|
photo.RotationDegrees += .1f; |
|
|
|
} |
|
|
@ -700,6 +704,7 @@ public class Game : GameWindow { |
|
|
|
} |
|
|
|
|
|
|
|
// Handle tool switching.
|
|
|
|
// FIXME: prevent photo switching when tools other than ViewTool are active?
|
|
|
|
if (photos[photoIndex] != previousPhoto) { |
|
|
|
activeTool = viewTool; |
|
|
|
} |
|
|
@ -708,7 +713,7 @@ public class Game : GameWindow { |
|
|
|
if (input.IsKeyPressed(Keys.C)) { |
|
|
|
activeTool = new CropTool(photos[photoIndex]); |
|
|
|
} |
|
|
|
if (input.IsKeyPressed(Keys.S)) { |
|
|
|
if (input.IsKeyPressed(Keys.X)) { |
|
|
|
activeTool = new StraightenTool(photos[photoIndex]); |
|
|
|
} |
|
|
|
} |
|
|
@ -789,10 +794,10 @@ public class Game : GameWindow { |
|
|
|
// Load photos from a directory.
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\desktop\photos-test\");
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\pictures\photos\2023\07\14\");
|
|
|
|
string[] files = Directory.GetFiles(@"c:\users\colin\pictures\photos\2023\09\06\jpg"); |
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\pictures\photos\2023\09\06\jpg");
|
|
|
|
// string[] files = Directory.GetFiles(@"G:\DCIM\100EOSR6\");
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\desktop\totte-output\2023\08\03");
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\desktop\export");
|
|
|
|
string[] files = Directory.GetFiles(@"c:\users\colin\desktop\export"); |
|
|
|
// string[] files = Directory.GetFiles(@"C:\Users\colin\Pictures\photos\2018\06\23");
|
|
|
|
// string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\Germany all\104D7000");
|
|
|
|
// string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\many-birds\");
|
|
|
|