1- import {
2- combinePatterns ,
3- getBoundariesFromPattern ,
4- getScreenSize ,
5- mapPointToViewportSpace ,
6- } from './functions'
1+ import { combinePatterns , getBoundariesFromPattern , getScreenSize } from './functions'
72import { Queue } from './queue'
8- import {
9- AbsoluteNumber ,
10- AbsolutePattern ,
11- Boundaries ,
12- Pattern ,
13- PatternNumber ,
14- Point ,
15- Size ,
16- State ,
17- ViewportPattern ,
18- } from './types'
3+ import { AbsoluteNumber , AbsolutePattern , Boundaries , State } from './types'
194
205// -- constants
216
@@ -33,28 +18,6 @@ const MAX_QUEUE_SIZE = 1e6
3318const MIN_PATTERN_SIZE = 0.0005 // ignore patterns where either side is smaller than this
3419const DEBUG = true as boolean
3520
36- // -- helper functions
37-
38- // eslint-disable-next-line @typescript-eslint/no-unused-vars
39- const mapPatternToViewportSpace = ( pattern : AbsolutePattern , screenSize : Size ) : ViewportPattern => ( {
40- anchor : mapPointToViewportSpace ( pattern . anchor , screenSize ) ,
41- target : mapPointToViewportSpace ( pattern . target , screenSize ) ,
42- } )
43-
44- // eslint-disable-next-line @typescript-eslint/no-unused-vars
45- const getPatternPoints = < N extends PatternNumber > (
46- pattern : Pattern < N >
47- ) : [ Point < N > , Point < N > , Point < N > , Point < N > ] => {
48- const { xMin, xMax, yMin, yMax } = getBoundariesFromPattern ( pattern )
49-
50- return [
51- [ xMin , yMin ] , // top left
52- [ xMax , yMin ] , // top right
53- [ xMax , yMax ] , // bottom right
54- [ xMin , yMax ] , // bottom left
55- ]
56- }
57-
5821// We'll ignore everything that's a bit outside the viewport.
5922// This is not really accurate, but should be OK for our purposes.
6023const VALID_BOUNDARIES : Boundaries < AbsoluteNumber > = {
@@ -224,7 +187,7 @@ export function* drawFrameIncrementally(
224187
225188 const duration = measure ( ( ) => {
226189 const start = performance . now ( )
227-
190+
228191 while ( true ) {
229192 const iteratorResult = chunkedDrawsIterator . next ( )
230193
0 commit comments