mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #10544 from hpvb/fix-10524-2.1
[2.1] Change order of Null check for ParallaxLayer
This commit is contained in:
commit
fb90ac8e48
1 changed files with 4 additions and 4 deletions
|
|
@ -32,11 +32,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();
|
||||
|
|
@ -52,11 +52,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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue