Skip to content

Commit fe20135

Browse files
authored
Merge pull request #11 from stillyslalom/patch-1
Use `Rational` for specification of aspect ratio
2 parents d5c8f88 + c6cfbbd commit fe20135

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/render.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
function render(scene::HittableList, cam::Camera{T}, image_width=400,
99
n_samples=1) where T
1010
# Image
11-
aspect_ratio = T(16.0/9.0) # TODO: use cam.aspect_ratio for consistency
12-
image_height = convert(Int64, floor(image_width / aspect_ratio))
11+
aspect_ratio = 16//9 # TODO: use cam.aspect_ratio for consistency
12+
image_height = image_width ÷ aspect_ratio
1313

1414
# Render
1515
img = zeros(RGB{T}, image_height, image_width)

0 commit comments

Comments
 (0)