From c58a816cc5a5af03767e98d2a495e1c8ab8808ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mika=20Isoj=C3=A4rvi?= Date: Mon, 13 Apr 2015 13:54:16 -0700 Subject: [PATCH] Fix random viewport calculation in lifetime tests. Bug: 20177344 Change-Id: I9e0043642ad63257b663823c99a8ea01118138f7 --- modules/glshared/glsLifetimeTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/glshared/glsLifetimeTests.cpp b/modules/glshared/glsLifetimeTests.cpp index e1c59ad..2332bae 100644 --- a/modules/glshared/glsLifetimeTests.cpp +++ b/modules/glshared/glsLifetimeTests.cpp @@ -494,9 +494,9 @@ Rectangle randomViewport (const RenderContext& ctx, GLint maxWidth, GLint maxHei { const RenderTarget& target = ctx.getRenderTarget(); const GLint width = de::min(target.getWidth(), maxWidth); - const GLint xOff = rnd.getInt(0, width - maxWidth); + const GLint xOff = rnd.getInt(0, target.getWidth() - width); const GLint height = de::min(target.getHeight(), maxHeight); - const GLint yOff = rnd.getInt(0, height - maxHeight); + const GLint yOff = rnd.getInt(0, target.getHeight() - height); return Rectangle(xOff, yOff, width, height); } -- 2.7.4