From 028c4d5a9653f2b6d1d03f84bceae679db885f9f Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 15 Jul 2010 20:03:53 +0000 Subject: [PATCH] Fixed wrong texture coordinates when displaying a part of a render-image with a sprite git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1529 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/Graphics/Image.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp index 229fa9c3..e0b4f735 100644 --- a/src/SFML/Graphics/Image.cpp +++ b/src/SFML/Graphics/Image.cpp @@ -522,10 +522,10 @@ FloatRect Image::GetTexCoords(const IntRect& rect) const if (myPixelsFlipped) { - return FloatRect( rect.Left / width, - (rect.Top + rect.Height) / height, - rect.Width / width, - -rect.Height / height); + return FloatRect( rect.Left / width, + (myWidth - rect.Top) / height, + rect.Width / width, + -rect.Height / height); } else {