scene: Fix division by 0

Close #9291