Browse Source

Merge pull request #32791 from groud/fix_sprite_frame_coords

Fixes Sprite's frame_coords
Rémi Verschelde 5 years ago
parent
commit
3bf3a0abaa
2 changed files with 4 additions and 4 deletions
  1. 2 2
      scene/2d/sprite.cpp
  2. 2 2
      scene/3d/sprite_3d.cpp

+ 2 - 2
scene/2d/sprite.cpp

@@ -269,8 +269,8 @@ int Sprite::get_frame() const {
 }
 
 void Sprite::set_frame_coords(const Vector2 &p_coord) {
-	ERR_FAIL_INDEX(int(p_coord.x), vframes);
-	ERR_FAIL_INDEX(int(p_coord.y), hframes);
+	ERR_FAIL_INDEX(int(p_coord.x), hframes);
+	ERR_FAIL_INDEX(int(p_coord.y), vframes);
 
 	set_frame(int(p_coord.y) * hframes + int(p_coord.x));
 }

+ 2 - 2
scene/3d/sprite_3d.cpp

@@ -593,8 +593,8 @@ int Sprite3D::get_frame() const {
 }
 
 void Sprite3D::set_frame_coords(const Vector2 &p_coord) {
-	ERR_FAIL_INDEX(int(p_coord.x), vframes);
-	ERR_FAIL_INDEX(int(p_coord.y), hframes);
+	ERR_FAIL_INDEX(int(p_coord.x), hframes);
+	ERR_FAIL_INDEX(int(p_coord.y), vframes);
 
 	set_frame(int(p_coord.y) * hframes + int(p_coord.x));
 }