Commit ae735013 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graph] take screenshot of canvases in proper order

We should hide edges under nodes, this was the other way around before
the change.
parent e6752ec1
...@@ -194,10 +194,14 @@ function takeScreenshot(sigma) { ...@@ -194,10 +194,14 @@ function takeScreenshot(sigma) {
let c = sigma.renderers[0].container; let c = sigma.renderers[0].container;
let edges = c.getElementsByClassName('sigma-edges')[0]; let edges = c.getElementsByClassName('sigma-edges')[0];
let scene = c.getElementsByClassName('sigma-scene')[0]; let scene = c.getElementsByClassName('sigma-scene')[0];
let sceneCtx = scene.getContext('2d'); // let sceneCtx = scene.getContext('2d');
sceneCtx.globalAlpha = 1; // sceneCtx.globalAlpha = 1;
sceneCtx.drawImage(edges, 0, 0); // sceneCtx.drawImage(edges, 0, 0);
return scene.toDataURL('image/png'); // return scene.toDataURL('image/png');
let edgesCtx = edges.getContext('2d');
edgesCtx.globalAlpha = 1;
edgesCtx.drawImage(scene, 0, 0);
return edges.toDataURL('image/png');
} }
function getEdges(sigma) { function getEdges(sigma) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment