FS#110 - Fixed 1 pixel offset in Sprite::GetPixel when FlipX or FlipY is set

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1088 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
laurentgom 2009-05-08 09:58:07 +00:00
parent 19de148351
commit 494c8e6d0f

View File

@ -162,8 +162,8 @@ Color Sprite::GetPixel(unsigned int X, unsigned int Y) const
unsigned int ImageX = mySubRect.Left + X;
unsigned int ImageY = mySubRect.Top + Y;
if (myIsFlippedX) ImageX = mySubRect.GetWidth() - ImageX;
if (myIsFlippedY) ImageY = mySubRect.GetHeight() - ImageY;
if (myIsFlippedX) ImageX = mySubRect.GetWidth() - ImageX - 1;
if (myIsFlippedY) ImageY = mySubRect.GetHeight() - ImageY - 1;
return myImage->GetPixel(ImageX, ImageY) * GetColor();
}