aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHein-Pieter van Braam2017-08-22 15:13:31 +0200
committerHein-Pieter van Braam2017-08-22 15:13:31 +0200
commit0a14e78a60f227c6415f14be4c6b14f4587e26ab (patch)
treef7ee388db0fa71a99beb8c4d3ef1dc335919474f
parent8a4e05a440d53be6247ee14c6b4928c07b4a83ae (diff)
downloadgodot-0a14e78a60f227c6415f14be4c6b14f4587e26ab.tar.gz
godot-0a14e78a60f227c6415f14be4c6b14f4587e26ab.tar.zst
godot-0a14e78a60f227c6415f14be4c6b14f4587e26ab.zip
-rw-r--r--scene/2d/parallax_layer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 4b62d7064..debdc22b6 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -34,11 +34,11 @@
void ParallaxLayer::set_motion_scale(const Size2 &p_scale) {
+ motion_scale = p_scale;
+
if (!get_parent())
return;
- motion_scale = p_scale;
-
ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
if (is_inside_tree() && pb) {
Vector2 ofs = pb->get_final_offset();
@@ -54,11 +54,11 @@ Size2 ParallaxLayer::get_motion_scale() const {
void ParallaxLayer::set_motion_offset(const Size2 &p_offset) {
+ motion_offset = p_offset;
+
if (!get_parent())
return;
- motion_offset = p_offset;
-
ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
if (is_inside_tree() && pb) {
Vector2 ofs = pb->get_final_offset();