Update phantomscript.js

Computing the display size seems to cause the svg rendering to complete bofore saving the image. Referencing issue #181 https://github.com/knsv/mermaid/issues/181
This commit is contained in:
phairow 2015-07-02 14:53:35 -07:00
parent 6f96b5dd14
commit af0d40e907

View File

@ -256,6 +256,10 @@ function executeInPage(data) {
svg = document.querySelector('svg')
svgValue = xmlSerializer.serializeToString(svg)
// make sure the entire view area is calculated before exiting
// this solves an issue where the svg is not done rendering when the image is created
svg.getBBox();
//console.log(document.body.outerHTML);
return svgValue