Fixes Sprite frame_coords

This commit is contained in:
Gilles Roudiere 2019-10-13 08:44:44 +02:00
parent a9fe81efbd
commit b27ec4aea7
2 changed files with 4 additions and 4 deletions

View file

@ -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));
}

View file

@ -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));
}