Merge pull request #43147 from Mallos/fix/sprite2d-rect

fix(sprite2d): Rect is not handling pixel snap
This commit is contained in:
Rémi Verschelde 2020-10-28 10:16:34 +01:00 committed by GitHub
commit 6328f7a45c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,6 +366,9 @@ Rect2 Sprite2D::get_rect() const {
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);