diff options
| author | Bernhard Liebl | 2018-03-04 21:19:32 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-03-28 23:54:10 +0200 |
| commit | 73cc3a96c0d5a706b1bd754986b39262bf66972d (patch) | |
| tree | 81c67ad5c0f621c76e67fb98dce00d3ed699295f /scene/2d/sprite.cpp | |
| parent | 683511310e186b7bca6da3e7694850738a26a72e (diff) | |
| download | godot-73cc3a96c0d5a706b1bd754986b39262bf66972d.tar.gz godot-73cc3a96c0d5a706b1bd754986b39262bf66972d.tar.zst godot-73cc3a96c0d5a706b1bd754986b39262bf66972d.zip | |
Fix uninitialized data in Sprite::_get_rects()
(cherry picked from commit 5f917139ab4050b9e03edff71ceeb5cff7abd386)
Diffstat (limited to '')
| -rw-r--r-- | scene/2d/sprite.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 9c344b958..5c99ed7de 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -63,8 +63,8 @@ void Sprite::_get_rects(Rect2 &r_src_rect, Rect2 &r_dst_rect, bool &r_filter_cli s = s / Size2(hframes, vframes); r_src_rect.size = s; - r_src_rect.position.x += float(frame % hframes) * s.x; - r_src_rect.position.y += float(frame / hframes) * s.y; + r_src_rect.position.x = float(frame % hframes) * s.x; + r_src_rect.position.y = float(frame / hframes) * s.y; } Point2 ofs = offset; |
