From 6a636203e54d570e4623dd8713d5b8a04c42d7bb Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Thu, 28 Dec 2017 20:47:02 -0500
Subject: [PATCH] ignore graphic updates for [vu] inside GOP but outside the
 bounds of the GOP rect

Unfortunately Pd will send graphic updates for gui objects that are
in a GOP canvas yet are outside the bounds of the rect.
---
 pd/nw/pdgui.js | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 16f09fd33..3fa54195a 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -2952,13 +2952,18 @@ function gui_vumeter_draw_peak(cid,tag,color,p1,p2,p3,p4,width,basex,basey) {
 
 // probably should change tag from "rect" to "cover"
 function gui_vumeter_update_rms(cid, tag, p1, p2, p3, p4, basex, basey) {
-    var rect = get_item(cid, tag + "rect");
-    configure_item(rect, {
-        x: p1 - basex,
-        y: p2 - basey,
-        width: p3 - p1,
-        height: p4 - p2 + 1
-    });
+    var rect;
+    if (patchwin[cid]) {
+        rect = get_item(cid, tag + "rect");
+        if (rect) {
+            configure_item(rect, {
+                x: p1 - basex,
+                y: p2 - basey,
+                width: p3 - p1,
+                height: p4 - p2 + 1
+            });
+        }
+    }
 }
 
 function gui_vumeter_update_peak(cid,tag,color,p1,p2,p3,p4,basex,basey) {
-- 
GitLab