Skip to content

Commit 5acb2eb

Browse files
committed
Tweak to avoid regression.
1 parent 73ecda0 commit 5acb2eb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/renderers/_base.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,17 +1706,24 @@ export abstract class RendererBase {
17061706
throw new Error("The `flood` marker can only be used if polygons are passed to the marking code.");
17071707
}
17081708
let isGradient = false;
1709+
let isFlatten = false;
17091710
let colour: string|SVGGradient = this.options.colourContext.fill;
17101711
if ( ("colour" in marker) && (marker.colour !== undefined) ) {
17111712
if (typeof marker.colour === "object" && ("stops" in marker.colour)) {
17121713
isGradient = true;
1714+
} else if (typeof marker.colour === "object" && ("func" in marker.colour) && marker.colour.func === "flatten") {
1715+
isFlatten = true;
17131716
}
17141717
colour = this.resolveColour(marker.colour);
17151718
}
17161719
let opacity = 0.25;
17171720
if ( ("opacity" in marker) && (marker.opacity !== undefined) ) {
17181721
opacity = marker.opacity;
17191722
}
1723+
// don't do automatic opacity of function is flatten
1724+
else if (isFlatten) {
1725+
opacity = 1;
1726+
}
17201727
let pattern: string | undefined;
17211728
if ( ("pattern" in marker) && (marker.pattern !== undefined) && (marker.pattern.length > 0) ) {
17221729
pattern = marker.pattern;

0 commit comments

Comments
 (0)