Skip to content

Commit

Permalink
#1249 - Fixes hovered nodes layer not being cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
jacomyal committed May 25, 2022
1 parent d95fab7 commit 2531ff6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sigma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ export default class Sigma extends TypedEventEmitter<SigmaEvents> {
this.hoveredNode = null;

this.emit("leaveNode", { ...baseEvent, node });
return this.scheduleHighlightedNodesRender();
this.scheduleHighlightedNodesRender();
return;
}
}

Expand Down Expand Up @@ -1128,7 +1129,9 @@ export default class Sigma extends TypedEventEmitter<SigmaEvents> {
const data = this.nodeDataCache[node];
this.hoverNodePrograms[data.type].process(data, data.hidden, nodesPerPrograms[data.type]++);
});
// 4. Render:
// 4. Clear hovered nodes layer:
this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);
// 5. Render:
for (const type in this.hoverNodePrograms) {
const program = this.hoverNodePrograms[type];

Expand Down Expand Up @@ -1486,7 +1489,7 @@ export default class Sigma extends TypedEventEmitter<SigmaEvents> {
clear(): this {
this.webGLContexts.nodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT);
this.webGLContexts.edges.clear(this.webGLContexts.edges.COLOR_BUFFER_BIT);
this.webGLContexts.hoverNodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT);
this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);
this.canvasContexts.labels.clearRect(0, 0, this.width, this.height);
this.canvasContexts.hovers.clearRect(0, 0, this.width, this.height);
this.canvasContexts.edgeLabels.clearRect(0, 0, this.width, this.height);
Expand Down

0 comments on commit 2531ff6

Please sign in to comment.