Fixed line width after love.graphics.scale with negative numbers (resolves issue #808)

This commit is contained in:
Alex Szpakowski
2013-12-18 03:15:44 -04:00
parent 71dd15838e
commit d0d629a314
+6 -1
View File
@@ -18,6 +18,7 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
// LOVE
#include "common/config.h"
#include "common/math.h"
#include "common/Vector.h"
@@ -26,11 +27,15 @@
#include "window/sdl/Window.h"
#include "Polyline.h"
// C++
#include <vector>
#include <sstream>
#include <algorithm>
#include <iterator>
// C
#include <cmath>
namespace love
{
namespace graphics
@@ -1028,7 +1033,7 @@ void Graphics::rotate(float r)
void Graphics::scale(float x, float y)
{
glScalef(x, y, 1);
pixel_size_stack.back() *= 2. / double(x + y);
pixel_size_stack.back() *= 2. / (fabs(x) + fabs(y));
}
void Graphics::translate(float x, float y)