2
0
Эх сурвалжийг харах

Fix Snake for new lengths in LineCanvas (#2548)

Thomas Nind 2 жил өмнө
parent
commit
889e66a7c4

+ 6 - 6
UICatalog/Scenarios/Snake.cs

@@ -87,10 +87,10 @@ namespace UICatalog.Scenarios {
 
 
 				var canvas = new LineCanvas ();
 				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++) {
 				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 orientation = pt1.X == pt2.X ? Orientation.Vertical : Orientation.Horizontal;
 					var length = orientation == 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 (
 					canvas.AddLine (
 						pt2,
 						pt2,