Browse Source

fixed animframe flip

[email protected] 8 years ago
parent
commit
c9fd82c307
1 changed files with 4 additions and 8 deletions
  1. 4 8
      oxygine/src/AnimationFrame.cpp

+ 4 - 8
oxygine/src/AnimationFrame.cpp

@@ -54,16 +54,10 @@ namespace oxygine
     {
         AnimationFrame f = *this;
         if (vertical)
-        {
-            f._srcRect.setY(_srcRect.getBottom());
-            f._srcRect.setHeight(-_srcRect.getHeight());
-        }
+            f.flipY();
 
         if (horizontal)
-        {
-            f._srcRect.setX(_srcRect.getRight());
-            f._srcRect.setWidth(-_srcRect.getWidth());
-        }
+            f.flipX();
 
         return f;
     }
@@ -72,12 +66,14 @@ namespace oxygine
     {
         _srcRect.setX(_srcRect.getRight());
         _srcRect.setWidth(-_srcRect.getWidth());
+        _destRect.pos.x = _frameSize.x - _destRect.getRight();
     }
 
     void AnimationFrame::flipY()
     {
         _srcRect.setY(_srcRect.getBottom());
         _srcRect.setHeight(-_srcRect.getHeight());
+        _destRect.pos.y = _frameSize.y - _destRect.getBottom();
     }
 
     AnimationFrame::AnimationFrame(spNativeTexture t)