Browse Source

Merge branch 'jimmyR-master' resolves #3741

Daniel Lee 10 years ago
parent
commit
5f1fe13530
1 changed files with 9 additions and 0 deletions
  1. 9 0
      vendor/phantomjs/render.js

+ 9 - 0
vendor/phantomjs/render.js

@@ -49,6 +49,15 @@
       });
 
       if (canvas || tries === 1000) {
+        var bb = page.evaluate(function () { 
+          return document.getElementsByClassName("main-view")[0].getBoundingClientRect(); 
+        });
+          page.clipRect = {
+          top:    bb.top,
+          left:   bb.left,
+          width:  bb.width,
+          height: bb.height
+        };
         page.render(params.png);
         phantom.exit();
       }