Skip to content

Commit 5e250e6

Browse files
committed
Fix function name
1 parent 55e6036 commit 5e250e6

19 files changed

Lines changed: 37 additions & 37 deletions

src/boards/cairoCatalan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoardReturn, getCellFill } from ".";
1+
import { BoardReturn, getBoardFill } from ".";
22
import { centroid } from "../common/plotting";
33
import { GridPoints, IPoint, IPolyPolygon, snubsquare } from "../grids";
44
import { RendererBase } from "../renderers/_base";
@@ -100,7 +100,7 @@ export const cairoCatalan = (ctx: RendererBase): BoardReturn => {
100100
blocked = [...(ctx.json.board.blocked as Blocked)];
101101
}
102102

103-
const [hexFill, hexOpacity] = getCellFill(ctx);
103+
const [hexFill, hexOpacity] = getBoardFill(ctx);
104104
for (let iRow = 0; iRow < height; iRow++) {
105105
for (let iCol = 0; iCol < width; iCol++) {
106106
if (blocked !== undefined) {

src/boards/cairoCollinear.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Symbol as SVGSymbol } from "@svgdotjs/svg.js";
22
import { cairo, IPoint, IPolyPolygon } from "../grids";
33
import { RendererBase } from "../renderers/_base";
44
import { BoardBasic } from "../schemas/schema";
5-
import { BoardReturn, getCellFill } from ".";
5+
import { BoardReturn, getBoardFill } from ".";
66

77
export const cairoCollinear = (ctx: RendererBase): BoardReturn => {
88
if ( (ctx.json === undefined) || (ctx.rootSvg === undefined) ) {
@@ -56,7 +56,7 @@ export const cairoCollinear = (ctx: RendererBase): BoardReturn => {
5656
const half = cellsize / 2;
5757
const quarter = cellsize / 4;
5858
const widest = half + quarter;
59-
const [hexFill, hexOpacity] = getCellFill(ctx, "white");
59+
const [hexFill, hexOpacity] = getBoardFill(ctx, "white");
6060

6161
const pentN = ctx.rootSvg.defs().symbol().id("pentagon-symbol-N").viewbox(0 - widest - 1, 0 - half - 1, (cellsize * 1.5) + 2, cellsize + 2);
6262
const ptsN: IPoint[] = [{x: 0, y: 0 - half}, {x: widest, y: 0 - quarter}, {x: half, y: half}, {x: 0 - half, y: half}, {x: 0 - widest, y: 0 - quarter}];

src/boards/cobweb.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Element as SVGElement, StrokeData } from "@svgdotjs/svg.js";
22
import { RendererBase } from "../renderers/_base";
33
import { ICobwebArgs, cobweb as cobwebGrid, cobwebLabels, cobwebPolys } from "../grids/cobweb";
4-
import { BoardReturn, getCellFill } from ".";
4+
import { BoardReturn, getBoardFill } from ".";
55

66
export const cobweb = (ctx: RendererBase): BoardReturn => {
77
if ( (ctx.json === undefined) || (ctx.rootSvg === undefined) ) {
@@ -46,7 +46,7 @@ export const cobweb = (ctx: RendererBase): BoardReturn => {
4646
const gridlines = board.group().id("gridlines");
4747

4848
// apply boardFill before the first markers
49-
const [hexFill, hexOpacity] = getCellFill(ctx, "white");
49+
const [hexFill, hexOpacity] = getBoardFill(ctx, "white");
5050
for (let y = 0; y < polys.length; y++) {
5151
const slice = polys[y];
5252
for (let x = 0; x < slice.length; x++) {

src/boards/conhex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoardReturn, getCellFill } from ".";
1+
import { BoardReturn, getBoardFill } from ".";
22
import { matrixRectRotN90 } from "../common/plotting";
33
import { GridPoints, IPoint, IPolyPolygon, rectOfRects } from "../grids";
44
import { RendererBase } from "../renderers/_base";
@@ -82,7 +82,7 @@ export const conhex = (ctx: RendererBase): BoardReturn => {
8282
blocked = [...(ctx.json.board.blocked as Blocked)];
8383
}
8484

85-
const [hexFill, hexOpacity] = getCellFill(ctx, "white");
85+
const [hexFill, hexOpacity] = getBoardFill(ctx, "white");
8686
for (let row = 0; row < cells.length; row++) {
8787
for (let col = 0; col < cells[row].length; col++) {
8888
if (blocked !== undefined && blocked.find(obj => obj.col === col && obj.row === row) !== undefined) {

src/boards/conicalHex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoardReturn, getCellFill } from ".";
1+
import { BoardReturn, getBoardFill } from ".";
22
import { conicalHex as conicalHexGrid, genConicalHexPolys } from "../grids";
33
import { RendererBase } from "../renderers/_base";
44

@@ -50,7 +50,7 @@ export const conicalHex = (ctx: RendererBase): BoardReturn => {
5050
const gridlines = board.group().id("hexes");
5151

5252
// boardFill has to happen before the first markers
53-
const [hexFill, hexOpacity] = getCellFill(ctx, "white");
53+
const [hexFill, hexOpacity] = getBoardFill(ctx, "white");
5454
for (let iRow = 0; iRow < grid.length; iRow++) {
5555
const row = polys[iRow];
5656
for (let iCol = 0; iCol < row.length; iCol++) {

src/boards/hexOfCir.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoardReturn, getCellFill } from ".";
1+
import { BoardReturn, getBoardFill } from ".";
22
import { IPolyCircle, hexOfCir as hexOfCirGrid } from "../grids";
33
import { RendererBase } from "../renderers/_base";
44

@@ -60,7 +60,7 @@ export const hexOfCir = (ctx: RendererBase, opts?: {noSvg: boolean}): BoardRetur
6060
}
6161

6262
// boardFill before first markers
63-
const [hexFill, hexOpacity] = getCellFill(ctx);
63+
const [hexFill, hexOpacity] = getBoardFill(ctx);
6464
const circleFilled = ctx.rootSvg.defs().symbol().id("circle-symbol-filled").viewbox(0, 0, cellsize, cellsize);
6565
circleFilled.circle(cellsize)
6666
.fill({color: hexFill, opacity: hexOpacity})

src/boards/hexOfHex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoardReturn, getCellFill } from ".";
1+
import { BoardReturn, getBoardFill } from ".";
22
import { IPoint, IPolyPolygon, hexOfHex as hexOfHexGrid } from "../grids";
33
import { RendererBase } from "../renderers/_base";
44

@@ -78,7 +78,7 @@ export const hexOfHex = (ctx: RendererBase, opts?: {noSvg: boolean}): BoardRetur
7878
if ( (ctx.json.board.blocked !== undefined) && (ctx.json.board.blocked !== null) && (Array.isArray(ctx.json.board.blocked)) && (ctx.json.board.blocked.length > 0) ){
7979
blocked = [...(ctx.json.board.blocked as Blocked)];
8080
}
81-
const [hexFill, hexOpacity] = getCellFill(ctx, "white");
81+
const [hexFill, hexOpacity] = getBoardFill(ctx, "white");
8282
const hexFilled = ctx.rootSvg.defs().symbol().id("hex-symbol-filled").viewbox(-3.3493649053890344, 0, 50, 50);
8383
hexFilled.polygon(pts.map(pt => `${pt.x},${pt.y}`).join(" "))
8484
.fill({color: hexFill, opacity: hexOpacity}).id("hex-symbol-poly-filled")

src/boards/hexOfTriF.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { GridPoints, IPoint, Poly } from "../grids";
33
import { RendererBase } from "../renderers/_base";
44
import { centroid } from "../common/plotting";
55
import { hexOfTri as hexOfTriGrid } from "../grids";
6-
import { BoardReturn, getCellFill } from ".";
6+
import { BoardReturn, getBoardFill } from ".";
77

88
export const hexOfTriF = (ctx: RendererBase): BoardReturn => {
99
if ( (ctx.json === undefined) || (ctx.rootSvg === undefined) ) {
@@ -121,7 +121,7 @@ export const hexOfTriF = (ctx: RendererBase): BoardReturn => {
121121
if ( (ctx.json.board.blocked !== undefined) && (ctx.json.board.blocked !== null) && (Array.isArray(ctx.json.board.blocked)) && (ctx.json.board.blocked.length > 0) ){
122122
blocked = [...(ctx.json.board.blocked as Blocked)];
123123
}
124-
const [cellFill, cellOpacity] = getCellFill(ctx, "white");
124+
const [cellFill, cellOpacity] = getBoardFill(ctx, "white");
125125
for (let y = 0; y < polys.length; y++) {
126126
const slice = polys[y];
127127
for (let x = 0; x < slice.length; x++) {

src/boards/hexSlanted.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BoardBasic } from "../schemas/schema";
22
import { IPoint, IPolyPolygon, hexSlanted as hexSlantedGrid} from "../grids";
33
import { RendererBase } from "../renderers/_base";
4-
import { BoardReturn, getCellFill } from ".";
4+
import { BoardReturn, getBoardFill } from ".";
55

66
export const hexSlanted = (ctx: RendererBase): BoardReturn => {
77
if ( (ctx.json === undefined) || (ctx.rootSvg === undefined) ) {
@@ -63,7 +63,7 @@ export const hexSlanted = (ctx: RendererBase): BoardReturn => {
6363
if ( (boardTyped.blocked !== undefined) && (boardTyped.blocked !== null) && (Array.isArray(boardTyped.blocked)) && (boardTyped.blocked.length > 0) ){
6464
blocked = [...(boardTyped.blocked as Blocked)];
6565
}
66-
const [hexFill, hexOpacity] = getCellFill(ctx, "white");
66+
const [hexFill, hexOpacity] = getBoardFill(ctx, "white");
6767
hexFilled.polygon(pts.map(pt => `${pt.x},${pt.y}`).join(" "))
6868
.fill({color: hexFill, opacity: hexOpacity}).id("hex-symbol-poly-filled")
6969
.stroke("none");

src/boards/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const pts2id = (a: [number,number], b: [number,number]): string => {
9696
}
9797

9898
// helpers for getting settings consistently across the boards
99-
export const getCellFill = (ctx: RendererBase, defColour: string|undefined = undefined, defOpacity = 0): [string|undefined, number] => {
99+
export const getBoardFill = (ctx: RendererBase, defColour: string|undefined = undefined, defOpacity = 0): [string|undefined, number] => {
100100
if (ctx.json === undefined || ctx.json.board === null) {
101101
throw new Error(`Context object in an invalid state.`);
102102
}

0 commit comments

Comments
 (0)