Commit 86576e1f authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

protect against superfluous messages sent from guis on graph-on-parent...

protect against superfluous messages sent from guis on graph-on-parent subcanvas that lies outside the bounding box
parent d202d6c9
...@@ -1879,14 +1879,21 @@ function gui_atom_draw_border(cid, tag, width, height) { ...@@ -1879,14 +1879,21 @@ function gui_atom_draw_border(cid, tag, width, height) {
function gui_atom_redraw_border(cid, tag, width, height) { function gui_atom_redraw_border(cid, tag, width, height) {
var g = get_gobj(cid, tag), var g = get_gobj(cid, tag),
p;
// Unfortunately Pd will send updates for gui objects that
// lie outside the bounding box of a graph-on-parent subpach.
// We should refrain from sending such messages from Pd, but for
// now this conditional guards against calling a method on null...
if (g) {
p = g.querySelector("polygon"); p = g.querySelector("polygon");
// When creating a new gatom, the C code sends messages // When creating a new gatom, the C code sends messages
// to redraw the border before the border exists. // to redraw the border before the border exists.
// So we have to check for existence here... // So we have to check for existence here...
if (p) { if (p) {
configure_item(p, { configure_item(p, {
points: atom_border_points(width, height) points: atom_border_points(width, height)
}); });
}
} }
} }
......
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