Browse Source

love.graphics.printf errors if the wrap limit parameter is negative (resolves issue #706)

Alex Szpakowski 12 years ago
parent
commit
acfce1bf47
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/modules/graphics/opengl/Graphics.cpp

+ 3 - 0
src/modules/graphics/opengl/Graphics.cpp

@@ -714,6 +714,9 @@ void Graphics::printf(const std::string &str, float x, float y, float wrap, Alig
 	if (currentFont == 0)
 		return;
 
+	if (wrap < 0.0f)
+		throw love::Exception("Horizontal wrap limit cannot be negative.");
+
 	using std::string;
 	using std::vector;