Skip to content

Commit c03b5af

Browse files
committed
Use mesh size
1 parent 020cfab commit c03b5af

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/geom/mesh/GenerateGridVerts.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,11 @@ var GenerateGridVerts = function (config)
9191

9292
var textureFrame = texture.get(frame);
9393

94-
// If the Mesh is ortho and no width/height is given, we'll default to texture sizes (if set!)
95-
if (!widthSet && isOrtho && texture)
94+
// If the Mesh is ortho and no width / height is given, we'll default to texture sizes (if set!)
95+
if (!widthSet && isOrtho && texture && mesh)
9696
{
97-
var renderer = mesh.scene.sys.renderer;
98-
99-
width = textureFrame.width / renderer.height;
100-
height = textureFrame.height / renderer.height;
97+
width = textureFrame.width / mesh.height;
98+
height = textureFrame.height / mesh.height;
10199
}
102100

103101
var halfWidth = width / 2;

0 commit comments

Comments
 (0)