diff options
author | SeleckyErik <35656626+SeleckyErik@users.noreply.github.com> | 2021-09-01 14:57:14 +0200 |
---|---|---|
committer | SeleckyErik <35656626+SeleckyErik@users.noreply.github.com> | 2021-09-01 14:57:14 +0200 |
commit | 7741afb55a3ad5a11097ff723e8bee4f69ba13d1 (patch) | |
tree | 1b9328997c4913cacc7d8d483e89a165069bfb96 | |
parent | a2f808fc9235b581d9b4aaec561154c49a4b55ab (diff) |
Fix ParallaxLayer's transform resetting in editor
Disable resetting of ParallaxLayer's position and scale in editor to
allow setting the initial values.
-rw-r--r-- | scene/2d/parallax_layer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 1fe6a4a4b8..67e35cc7a3 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -100,6 +100,10 @@ void ParallaxLayer::_notification(int p_what) { _update_mirroring(); } break; case NOTIFICATION_EXIT_TREE: { + if (Engine::get_singleton()->is_editor_hint()) { + break; + } + set_position(orig_offset); set_scale(orig_scale); } break; |