diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-23 21:41:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-23 21:41:19 +0200 |
commit | 2408e214a71522b3100ea28f40bd3b15717298b6 (patch) | |
tree | e3a2dc691bdb6207cc67d8c7d49ff988a3ae8757 | |
parent | 9008cc486e28553ff8ea07639245efedcf545be2 (diff) | |
parent | fa9148f3432cd2fd01e87e60d875e9952cf0aa3f (diff) |
Merge pull request #33006 from Chaosus/fix_billboard_bug
Allows change Sprite3D scale if Billboard mode is enabled
-rw-r--r-- | scene/resources/material.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 0de462d616..31d294b7ca 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1804,10 +1804,9 @@ RID SpatialMaterial::get_material_rid_for_2d(bool p_shaded, bool p_transparent, material->set_flag(FLAG_SRGB_VERTEX_COLOR, true); material->set_flag(FLAG_ALBEDO_FROM_VERTEX_COLOR, true); material->set_flag(FLAG_USE_ALPHA_SCISSOR, p_cut_alpha); - if (p_billboard) { - material->set_billboard_mode(BILLBOARD_ENABLED); - } else if (p_billboard_y) { - material->set_billboard_mode(BILLBOARD_FIXED_Y); + if (p_billboard || p_billboard_y) { + material->set_flag(FLAG_BILLBOARD_KEEP_SCALE, true); + material->set_billboard_mode(p_billboard_y ? BILLBOARD_FIXED_Y : BILLBOARD_ENABLED); } materials_for_2d[version] = material; |