File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ impl Camera {
39
39
eprintln ! ( "\r Done. \n " ) ;
40
40
}
41
41
fn initialize ( & mut self ) {
42
- // Fix image stretcheness
43
42
self . image_height = ( self . image_width as f32 /self . aspect_ratio ) as i32 ;
44
43
self . image_height = if self . image_height < 1 { 1 } else { self . image_height } ;
45
44
@@ -48,7 +47,7 @@ impl Camera {
48
47
self . center = Point3 :: from ( 0.0 , 0.0 , 0.0 ) ;
49
48
let focal_length = 1.0f32 ;
50
49
let viewport_height = 2.0f32 ;
51
- let viewport_width = viewport_height * ( ( self . image_width /self . image_height ) as f32 ) ;
50
+ let viewport_width = viewport_height * ( self . image_width as f32 /self . image_height as f32 ) ;
52
51
53
52
let viewport_u = Vec3 :: from ( viewport_width, 0.0 , 0.0 ) ;
54
53
let viewport_v = Vec3 :: from ( 0.0 , -viewport_height, 0.0 ) ;
You can’t perform that action at this time.
0 commit comments