Skip to content

Commit 89831af

Browse files
committed
Add comments in constants.ts
1 parent 8a77016 commit 89831af

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

src/draw/constants.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/** Rendering is aborted if the queue size exceeds this. */
12
export const MAX_QUEUE_SIZE = 1e6
2-
// const MIN_PATTERN_SIZE = 0.0005 // ignore patterns where either side is smaller than this
3-
export const MIN_PATTERN_SIZE_PX = 1 // ignore patterns where either side is smaller than this// -- constants
3+
4+
/** Ignore patterns where either side is smaller than this. */
5+
export const MIN_PATTERN_SIZE_PX = 1
6+
7+
/** Number of colors to use. */
48
const COLOR_SIZE = 50
9+
10+
/** Colors to use. Depths past `COLOR_SIZE` use the last color in the array. */
511
export const COLORS = Array(COLOR_SIZE)
612
.fill(undefined)
713
.map((_, i) => {
@@ -13,8 +19,18 @@ export const COLORS = Array(COLOR_SIZE)
1319

1420
return `hsl(${hue} ${saturation}% ${lightness}%)`
1521
})
22+
23+
/** Always render to at least this depth in the initial frame. */
1624
export const MIN_DEPTH = 3
25+
26+
/** Never render past this depth. `Infinity` means no limit. */
1727
export const MAX_DEPTH = Infinity
18-
export const MAX_PREVIEW_DRAW_CALLS = 5e3 // number of shapes to draw per preview frame
19-
export const MAX_DRAW_TIME_MS = 15 // how long to draw a frame in ms
28+
29+
/** Maximum number of draw calls per preview frame. */
30+
export const MAX_PREVIEW_DRAW_CALLS = 5e3
31+
32+
/** Maximum time to draw a frame in ms. */
33+
export const MAX_DRAW_TIME_MS = 15
34+
35+
/** Whether to enable debug logging. */
2036
export const DEBUG = true as boolean

0 commit comments

Comments
 (0)