Fix compile warning: Potential divide by zero #107254

Open
Iliya Katushenock wants to merge 1 commits from mod_moder/blender:avoid_divide_by_zero into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ static float mode_transfer_alpha_for_animation_time_get(const float anim_time)
float alpha = 0.0f;
if (anim_time < flash_fade_in_time) {
alpha = anim_time / flash_fade_in_time;
if constexpr (flash_fade_in_time != 0.0f) {
alpha = anim_time / flash_fade_in_time;
}
}
else {
const float fade_out_anim_time = anim_time - flash_fade_in_time;