Skip to content

Commit 6b961fb

Browse files
author
psilo
committed
Changed drawing of grid to float in order to reduce inconsistencies on different screen resolutions.
1 parent ac3b6b2 commit 6b961fb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Test/DrawableGrid.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public override void Draw(GameTime gameTime)
9595
{
9696
for (int y = 0; y < Grid.NumberOfCellsY; y++)
9797
{
98-
Rectangle cell = new Rectangle((int) (Position.X + x*Grid.CellWidth),
99-
(int) (Position.Y + y*Grid.CellHeight),
100-
(int) Grid.CellWidth, (int) Grid.CellHeight);
98+
RectangleF cell = new RectangleF(Position.X + x*Grid.CellWidth, Position.Y + y*Grid.CellHeight,
99+
Grid.CellWidth, Grid.CellHeight);
100+
101101
int l = Grid.Get(new Point(x, y)).Length;
102102

103103
Color c;

Test/Main.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
// ***************************************************************************
2727

2828
using System;
29+
using System.Security.Principal;
2930
using Microsoft.Xna.Framework;
3031
using Microsoft.Xna.Framework.Graphics;
3132

@@ -49,6 +50,7 @@ public Main()
4950

5051
Window.AllowUserResizing = true;
5152
Window.Position = Point.Zero;
53+
IsMouseVisible = true;
5254
}
5355

5456
protected override void Initialize()

0 commit comments

Comments
 (0)