Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 61f149c

Browse files
Update GameViewGridOverlay.cs
fix: need to draw past screensize to see last edges
1 parent 69fe35d commit 61f149c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎Assets/Scripts/Editor/Tools/GameViewGridOverlay.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,20 @@ private void OnGUI()
3232
int cellStrideX = gridSizeX + spacingX;
3333
int cellStrideY = gridSizeY + spacingY;
3434

35-
for (int y = startOffsetY; y + gridSizeY <= Screen.height; y += cellStrideY)
35+
// Loop until start of the cell is beyond screen, not end of cell
36+
for (int y = startOffsetY; y < Screen.height; y += cellStrideY)
3637
{
37-
for (int x = startOffsetX; x +gridSizeX<= Screen.width; x += cellStrideX)
38+
for (int x = startOffsetX; x < Screen.width; x += cellStrideX)
3839
{
39-
// Left line
40+
// Draw full box even if it goes beyond screen edges
41+
42+
// Left
4043
GUI.DrawTexture(new Rect(x, y, 1, gridSizeY), Texture2D.whiteTexture);
41-
// Right line
44+
// Right
4245
GUI.DrawTexture(new Rect(x + gridSizeX - 1, y, 1, gridSizeY), Texture2D.whiteTexture);
43-
// Top line
46+
// Top
4447
GUI.DrawTexture(new Rect(x, y, gridSizeX, 1), Texture2D.whiteTexture);
45-
// Bottom line
48+
// Bottom
4649
GUI.DrawTexture(new Rect(x, y + gridSizeY - 1, gridSizeX, 1), Texture2D.whiteTexture);
4750
}
4851
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /