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
This commit is contained in:
parent
c87c0d7d25
commit
028c4d5a96
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user