@@ -30,6 +30,10 @@ export class EntropyRenderer extends RendererBase {
3030 throw new Error ( `This 'board' schema cannot be handled by the '${ EntropyRenderer . rendererName } ' renderer.` ) ;
3131 }
3232
33+ let size = 7 ;
34+ if ( "size" in this . json . board ) {
35+ size = this . json . board . size as number ;
36+ }
3337 let label1 = "Player 1: Order" ;
3438 let label2 = "Player 2: Order" ;
3539 let occlude1 = false ;
@@ -65,9 +69,9 @@ export class EntropyRenderer extends RendererBase {
6569 baseOpacity = this . json . board . strokeOpacity ;
6670 }
6771
68- const width = 7 ;
69- const height = 7 ;
70- const boardOffset = cellsize * 8 ;
72+ const width = size ;
73+ const height = size ;
74+ const boardOffset = cellsize * ( size + 1 ) ;
7175 // Get a grid of points
7276 const grid1 = rectOfRects ( { gridHeight : height , gridWidth : width , cellSize : cellsize } ) ;
7377 let startx = boardOffset ;
@@ -89,10 +93,11 @@ export class EntropyRenderer extends RendererBase {
8993 boardlabel = label2 ;
9094 }
9195 let titlePoint : IPoint = { x : 0 , y : 0 } ;
96+ const half = Math . floor ( size / 2 ) ;
9297 if ( this . json . board . orientation === "vertical" ) {
93- titlePoint = { x : grid [ 0 ] [ 0 ] . x - ( cellsize * 1.5 ) , y : grid [ 3 ] [ 0 ] . y } ;
98+ titlePoint = { x : grid [ 0 ] [ 0 ] . x - ( cellsize * 1.5 ) , y : grid [ half ] [ 0 ] . y } ;
9499 } else {
95- titlePoint = { x : grid [ 0 ] [ 3 ] . x , y : grid [ 0 ] [ 0 ] . y - ( cellsize * 1.5 ) } ;
100+ titlePoint = { x : grid [ 0 ] [ half ] . x , y : grid [ 0 ] [ 0 ] . y - ( cellsize * 1.5 ) } ;
96101 }
97102
98103 const board = this . rootSvg . group ( ) . id ( boardid ) ;
0 commit comments