From 494c8e6d0f21072c4fab1af4f1c6b06d68efc2b0 Mon Sep 17 00:00:00 2001 From: laurentgom Date: Fri, 8 May 2009 09:58:07 +0000 Subject: [PATCH] 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 --- src/SFML/Graphics/Sprite.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp index 082b6cf4..a728d4b5 100644 --- a/src/SFML/Graphics/Sprite.cpp +++ b/src/SFML/Graphics/Sprite.cpp @@ -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(); }