diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs index fb1f06c7..bd40ea9c 100755 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs @@ -304,10 +304,13 @@ namespace Fungus x += gridSize; } - float y = fungusScript.scrollPos.y % gridSize; + float y = (fungusScript.scrollPos.y % gridSize); while (y < height) { - GLDraw.DrawLine(new Vector2(0, y), new Vector2(width, y), color, 1f); + if (y >= 0) + { + GLDraw.DrawLine(new Vector2(0, y), new Vector2(width, y), color, 1f); + } y += gridSize; } }