Skip to content

Commit ad2300f

Browse files
committed
fix bg colour and overlays
1 parent 39a5f3d commit ad2300f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/extensions/renderer/canvas/webgl/drawing-elements-webgl.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,11 +766,17 @@ export class ElementDrawingWebGL {
766766

767767
// Nodes should still be clickable if they pass the visibility check but
768768
// have background-opacity: 0
769-
const opacity = this.renderTarget.picking ? 1 : node.effectiveOpacity();
769+
let opacity = this.renderTarget.picking ? 1 : node.effectiveOpacity();
770+
let bgOpacity = this.renderTarget.picking ? 1 : node.pstyle('background-opacity').value * opacity;
771+
772+
if (type === 'node-overlay') {
773+
opacity = node.pstyle(props.opacity).value;
774+
bgOpacity = opacity;
775+
}
770776

771777
const color = node.pstyle(props.color).value;
772778
const colorView = this.colorBuffer.getView(instance);
773-
util.toWebGLColor(color, opacity, colorView);
779+
util.toWebGLColor(color, bgOpacity, colorView);
774780

775781
const lineWidthView = this.lineWidthBuffer.getView(instance); // reuse edge line width attribute for node border
776782
lineWidthView[0] = 0;

0 commit comments

Comments
 (0)