Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit f0c91f6

Browse files
authoredAug 11, 2018
Update raytracer.ts
`ctx.fillRect()` last 2 args should be width and height (not x2, y2) https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillRect will this fix https://www.typescriptlang.org/play/index.html too?
1 parent 1a9d4f9 commit f0c91f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎raytracer/raytracer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class RayTracer {
244244
var color = this.traceRay({ start: scene.camera.pos, dir: getPoint(x, y, scene.camera) }, scene, 0);
245245
var c = Color.toDrawingColor(color);
246246
ctx.fillStyle = "rgb(" + String(c.r) + ", " + String(c.g) + ", " + String(c.b) + ")";
247-
ctx.fillRect(x, y, x + 1, y + 1);
247+
ctx.fillRect(x, y, 1, 1);
248248
}
249249
}
250250
}

0 commit comments

Comments
 (0)
Failed to load comments.