@@ -25,11 +25,11 @@ interface PixiAppProps {
2525 showGoalVectors : boolean ,
2626}
2727
28- const PixiApp = forwardRef ( ( {
29- width,
30- height,
31- graph,
32- solution,
28+ const PixiApp = forwardRef ( ( {
29+ width,
30+ height,
31+ graph,
32+ solution,
3333 playAnimation,
3434 stepSize,
3535 loopAnimation,
@@ -42,7 +42,7 @@ const PixiApp = forwardRef(({
4242} : PixiAppProps , ref ) => {
4343 // this is a mess of state and refs, but how I got everything to work...
4444 // maybe someday I will clean this up or maybe someone who knows React better than me can help
45- //
45+ //
4646 // the variables that are used inside the animation callbacks must
4747 // be stored in refs because the callbacks are created "once" and
4848 // the variables are updated outside of the callbacks
@@ -51,7 +51,7 @@ const PixiApp = forwardRef(({
5151 const canvasRef = useRef < HTMLCanvasElement > ( null ) ;
5252 const [ grid , setGrid ] = useState < PIXI . Container | null > ( null ) ;
5353 const playAnimationRef = useRef ( playAnimation ) ;
54- const timestepRef = useRef ( 0.0 ) ;
54+ const timestepRef = useRef ( 0.0 ) ;
5555 const stepSizeRef = useRef ( 1.0 ) ;
5656 const loopAnimationRef = useRef ( loopAnimation ) ;
5757 const hudRef = useRef < PIXI . Container | null > ( null ) ;
@@ -140,7 +140,7 @@ const PixiApp = forwardRef(({
140140 agent . x =
141141 startPose . position . x +
142142 ( endPose . position . x - startPose . position . x ) * interpolationProgress ;
143- agent . y =
143+ agent . y =
144144 startPose . position . y +
145145 ( endPose . position . y - startPose . position . y ) * interpolationProgress ;
146146 agent . x = scalePosition ( agent . x ) ;
@@ -157,7 +157,7 @@ const PixiApp = forwardRef(({
157157 circleContainer . rotation =
158158 startRotation +
159159 ( endRotation - startRotation ) * interpolationProgress ;
160- } ) ;
160+ } ) ;
161161 } , [ solution ] ) ;
162162
163163 const updatePaths = useCallback ( ( agents : PIXI . Container [ ] , currentTime : number ) => {
@@ -166,11 +166,11 @@ const PixiApp = forwardRef(({
166166 const currentTimestep = Math . floor ( currentTime ) ;
167167 const interpolationProgress = currentTime - currentTimestep ;
168168
169-
169+
170170 agents . forEach ( ( _agent , index ) => {
171- const agentLineStyle = {
172- width : GRID_UNIT_TO_PX / 10 ,
173- color : AGENT_COLORS [ index % AGENT_COLORS . length ] ,
171+ const agentLineStyle = {
172+ width : GRID_UNIT_TO_PX / 10 ,
173+ color : AGENT_COLORS [ index % AGENT_COLORS . length ] ,
174174 cap : "round" as const
175175 } ;
176176
@@ -231,7 +231,7 @@ const PixiApp = forwardRef(({
231231 scalePosition ( goal . position . y )
232232 )
233233 . stroke ( {
234- color : AGENT_COLORS [ index % AGENT_COLORS . length ] ,
234+ color : AGENT_COLORS [ index % AGENT_COLORS . length ] ,
235235 width : Math . max ( 1 , GRID_UNIT_TO_PX / 25 ) ,
236236 cap : "round" as const
237237 } ) ;
@@ -254,7 +254,7 @@ const PixiApp = forwardRef(({
254254 }
255255 if ( solution === null ) return ;
256256 resetTimestep ( ) ;
257-
257+
258258 // Check if the solution is orientation-aware
259259 const orientationAware : boolean = solution [ 0 ] [ 0 ] . orientation !== Orientation . NONE ;
260260
@@ -316,7 +316,7 @@ const PixiApp = forwardRef(({
316316 idText . x = - idText . width / 2 ;
317317 idText . y = - idText . height / 2 ;
318318 } ) ;
319-
319+
320320 const animate = ( ) => {
321321 if ( timestepTextRef . current ) {
322322 timestepTextRef . current . text = `${ timestepRef . current . toFixed ( 1 ) } / ${ ( solution . length - 1 ) . toFixed ( 1 ) } ` ;
@@ -345,10 +345,10 @@ const PixiApp = forwardRef(({
345345 const canvas = canvasRef . current ;
346346 if ( canvas ) {
347347 const pixiApp = new PIXI . Application ( ) ;
348- pixiApp . init ( {
349- width : width ,
350- height : height ,
351- canvas : canvas ,
348+ pixiApp . init ( {
349+ width : width ,
350+ height : height ,
351+ canvas : canvas ,
352352 background : BACKGROUND_COLOR ,
353353 antialias : true , // for smooooooth circles
354354 } ) . then ( ( ) => {
@@ -377,7 +377,7 @@ const PixiApp = forwardRef(({
377377 fontFamily : "Arial" ,
378378 fontWeight : "bold" ,
379379 stroke : {
380- color : BACKGROUND_COLOR ,
380+ color : BACKGROUND_COLOR ,
381381 width : 4
382382 } ,
383383 } ) ;
@@ -408,7 +408,7 @@ const PixiApp = forwardRef(({
408408 const drawGrid = useCallback ( ( ) => {
409409 if ( viewport === null || graph === null ) return null ;
410410 const grid = viewport . addChild ( new PIXI . Container ( ) ) ;
411-
411+
412412 for ( let x : number = 0 ; x < graph . width ; x ++ ) {
413413 for ( let y : number = 0 ; y < graph . height ; y ++ ) {
414414 const cellContainer = grid . addChild ( new PIXI . Container ( ) ) ;
@@ -435,7 +435,7 @@ const PixiApp = forwardRef(({
435435 idText . y = cellY + strokeWidth ;
436436 }
437437 }
438-
438+
439439 viewport . worldHeight = grid . height * 1.2 ;
440440 viewport . worldWidth = grid . width * 1.2 ;
441441 return grid ;
@@ -502,4 +502,4 @@ const PixiApp = forwardRef(({
502502 return < canvas ref = { canvasRef } />
503503} ) ;
504504
505- export default PixiApp ;
505+ export default PixiApp ;
0 commit comments