mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix panic on minimizing window before the game starts up
This commit is contained in:
parent
1ed90bd0bf
commit
a044981fd7
@ -54,6 +54,9 @@ pub struct Camera {
|
||||
impl Camera {
|
||||
/// Create a new `Camera` with default parameters.
|
||||
pub fn new(aspect: f32, mode: CameraMode) -> Self {
|
||||
// Make sure aspect is valid
|
||||
let aspect = if aspect.is_normal() { aspect } else { 1.0 };
|
||||
|
||||
Self {
|
||||
tgt_focus: Vec3::unit_z() * 10.0,
|
||||
focus: Vec3::unit_z() * 10.0,
|
||||
|
Loading…
Reference in New Issue
Block a user