From b698ceb02759100461fae24487c2b7f38b0e423b Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 10 Jul 2015 23:56:19 -0400
Subject: [PATCH] add document.body for clientWidth/Height fields

---
 pd/nw/pdgui.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index f3f84a583..4d10b1078 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -3576,10 +3576,10 @@ function do_getscroll(cid) {
     var width = bbox.x > 0 ? bbox.x + bbox.width : bbox.width,
         height = bbox.y > 0 ? bbox.y + bbox.height : bbox.height;
     if (width === 0) {
-        width = patchwin[cid].window.clientWidth;
+        width = patchwin[cid].window.document.body.clientWidth;
     }
     if (height === 0) {
-        height = patchwin[cid].window.clientHeight;
+        height = patchwin[cid].window.document.body.clientHeight;
     }
     configure_item(svg, {
         viewBox: [bbox.x > 0 ? 0 : bbox.x,
-- 
GitLab