Skip to content

Commit 73ecda0

Browse files
committed
Fix longstanding bug in flood fill markers. This has caused a regression, but that will need to be fixed in the individual games.
1 parent 6f66c65 commit 73ecda0

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/renderers/_base.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ export abstract class RendererBase {
17081708
let isGradient = false;
17091709
let colour: string|SVGGradient = this.options.colourContext.fill;
17101710
if ( ("colour" in marker) && (marker.colour !== undefined) ) {
1711-
if (typeof marker.colour === "object") {
1711+
if (typeof marker.colour === "object" && ("stops" in marker.colour)) {
17121712
isGradient = true;
17131713
}
17141714
colour = this.resolveColour(marker.colour);
@@ -1728,15 +1728,14 @@ export abstract class RendererBase {
17281728
if (isGradient) {
17291729
fill = colour as SVGGradient;
17301730
} else if (pattern !== undefined) {
1731-
if (pattern !== undefined) {
1732-
fill = this.rootSvg.findOne(`#${pattern}`) as SVGElement;
1733-
if (fill === undefined) {
1734-
throw new Error("Could not load the requested pattern.");
1735-
}
1731+
fill = this.rootSvg.findOne(`#${pattern}`) as SVGElement;
1732+
if (fill === undefined) {
1733+
throw new Error("Could not load the requested pattern.");
17361734
}
17371735
} else {
1738-
fill = {color: colour as string, opacity};
1736+
fill = {color: colour as string, opacity} as FillData;
17391737
}
1738+
console.log({colour, opacity, fill});
17401739
for (const point of marker.points as ITarget[]) {
17411740
let floodEle: SVGCircle|SVGPolygon|SVGPath|undefined;
17421741
const cell = polys[point.row][point.col];

0 commit comments

Comments
 (0)