Skip to content

Commit

Permalink
fix: mind map opacity (#9010)
Browse files Browse the repository at this point in the history
  • Loading branch information
doouding committed Dec 18, 2024
1 parent 2c68ec0 commit d5ce3a2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export function mindmap(

matrix = matrix.translate(-dx, -dy);

const mindmapOpacity = model.opacity;

const traverse = (node: MindmapNode) => {
const connectors = model.getConnectors(node);
if (!connectors) return;
Expand All @@ -40,10 +42,11 @@ export function mindmap(
const dx = connector.x - bound.x;
const dy = connector.y - bound.y;
const origin = ctx.globalAlpha;
const shouldSetGlobalAlpha = origin !== connector.opacity;
const shouldSetGlobalAlpha =
origin !== connector.opacity * mindmapOpacity;

if (shouldSetGlobalAlpha) {
ctx.globalAlpha = connector.opacity;
ctx.globalAlpha = connector.opacity * mindmapOpacity;
}

renderConnector(connector, ctx, matrix.translate(dx, dy), renderer, rc);
Expand Down

0 comments on commit d5ce3a2

Please sign in to comment.