1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

fix(sprite2d): Rect is not handling pixel snap

related https://github.com/godotengine/godot/issues/42985

(cherry picked from commit e892a92ad6)
This commit is contained in:
Eric Tuvesson
2020-10-27 23:34:19 +01:00
committed by Rémi Verschelde
parent 4ccde80d9d
commit 9320266fe8

View File

@@ -378,6 +378,9 @@ Rect2 Sprite::get_rect() const {
Point2 ofs = offset;
if (centered)
ofs -= Size2(s) / 2;
if (Engine::get_singleton()->get_use_pixel_snap()) {
ofs = ofs.floor();
}
if (s == Size2(0, 0))
s = Size2(1, 1);