Merge pull request #12132 from TheSofox/parallax-fixes

Tweaks ParallaxBackground to work better with zoom. 

[ci skip]
This commit is contained in:
Rémi Verschelde 2017-10-20 13:03:23 +02:00 committed by GitHub
commit 7f477dae26

View file

@ -49,8 +49,8 @@ void ParallaxBackground::_notification(int p_what) {
void ParallaxBackground::_camera_moved(const Transform2D &p_transform) {
set_scroll_offset(p_transform.get_origin());
set_scroll_scale(p_transform.get_scale().dot(Vector2(0.5, 0.5)));
set_scroll_offset(p_transform.get_origin() / p_transform.get_scale());
}
void ParallaxBackground::set_scroll_scale(float p_scale) {