Merge pull request #41934 from timothyqiu/parallax-ignore-zoom

Fixes ParallaxLayer offset when camera zoom is ignored
This commit is contained in:
Rémi Verschelde 2020-09-24 15:23:24 +02:00 committed by GitHub
commit f87c75f77b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,7 +101,7 @@ void ParallaxBackground::_update_scroll() {
}
if (ignore_camera_zoom) {
l->set_base_offset_and_scale(ofs, 1.0, screen_offset);
l->set_base_offset_and_scale((ofs + screen_offset * (scale - 1)) / scale, 1.0, screen_offset);
} else {
l->set_base_offset_and_scale(ofs, scale, screen_offset);
}