summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-20 13:03:23 +0200
committerGitHub <noreply@github.com>2017-10-20 13:03:23 +0200
commit7f477dae261d7c4684a1e29d780ff54220a7634a (patch)
treefdb894a9f845517686cbcd9dee9879098201c0c3 /scene
parent771b742047912b4abee93866cc5c68332e262230 (diff)
parentaaf6e77198007bfa0b6228315a08eac92aff0d35 (diff)
Merge pull request #12132 from TheSofox/parallax-fixes
Tweaks ParallaxBackground to work better with zoom. [ci skip]
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/parallax_background.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp
index 0ddcb7b51b..a13ce6278e 100644
--- a/scene/2d/parallax_background.cpp
+++ b/scene/2d/parallax_background.cpp
@@ -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) {