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:
parent
19de148351
commit
494c8e6d0f
@ -162,8 +162,8 @@ Color Sprite::GetPixel(unsigned int X, unsigned int Y) const
|
|||||||
unsigned int ImageX = mySubRect.Left + X;
|
unsigned int ImageX = mySubRect.Left + X;
|
||||||
unsigned int ImageY = mySubRect.Top + Y;
|
unsigned int ImageY = mySubRect.Top + Y;
|
||||||
|
|
||||||
if (myIsFlippedX) ImageX = mySubRect.GetWidth() - ImageX;
|
if (myIsFlippedX) ImageX = mySubRect.GetWidth() - ImageX - 1;
|
||||||
if (myIsFlippedY) ImageY = mySubRect.GetHeight() - ImageY;
|
if (myIsFlippedY) ImageY = mySubRect.GetHeight() - ImageY - 1;
|
||||||
|
|
||||||
return myImage->GetPixel(ImageX, ImageY) * GetColor();
|
return myImage->GetPixel(ImageX, ImageY) * GetColor();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user