Browse Source

Fix Snake for new lengths in LineCanvas (#2548)

Thomas Nind 2 years ago
parent
commit
889e66a7c4
1 changed files with 6 additions and 6 deletions
  1. 6 6
      UICatalog/Scenarios/Snake.cs

+ 6 - 6
UICatalog/Scenarios/Snake.cs

@@ -87,10 +87,10 @@ namespace UICatalog.Scenarios {
 
 				var canvas = new LineCanvas ();
 
-				canvas.AddLine (new Point (0, 0), State.Width - 1, Orientation.Horizontal, LineStyle.Double);
-				canvas.AddLine (new Point (0, 0), State.Height - 1, Orientation.Vertical, LineStyle.Double);
-				canvas.AddLine (new Point (0, State.Height - 1), State.Width - 1, Orientation.Horizontal, LineStyle.Double);
-				canvas.AddLine (new Point (State.Width - 1, 0), State.Height - 1, Orientation.Vertical, LineStyle.Double);
+				canvas.AddLine (new Point (0, 0), State.Width, Orientation.Horizontal, LineStyle.Double);
+				canvas.AddLine (new Point (0, 0), State.Height, Orientation.Vertical, LineStyle.Double);
+				canvas.AddLine (new Point (0, State.Height - 1), State.Width, Orientation.Horizontal, LineStyle.Double);
+				canvas.AddLine (new Point (State.Width - 1, 0), State.Height, Orientation.Vertical, LineStyle.Double);
 
 				for (int i = 1; i < State.Snake.Count; i++) {
 
@@ -99,8 +99,8 @@ namespace UICatalog.Scenarios {
 
 					var orientation = pt1.X == pt2.X ? Orientation.Vertical : Orientation.Horizontal;
 					var length = orientation == Orientation.Horizontal
-						? pt1.X > pt2.X ? 1 : -1
-						: pt1.Y > pt2.Y ? 1 : -1;
+						? pt1.X > pt2.X ? 2 : -2
+						: pt1.Y > pt2.Y ? 2 : -2;
 
 					canvas.AddLine (
 						pt2,