diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 86adcbc4f0a38dfdb8584e9f1cf2336eebf216b8..6eb17cdaae3a4c64b6e750948bac504f74702f32 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -169,7 +169,7 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist)
     t_object *ob;
 	//fprintf(stderr,"shouldvis %d %d %d %d\n", glist->gl_havewindow, glist->gl_isgraph, glist->gl_goprect, glist->gl_owner != NULL);
     if (!glist->gl_havewindow && glist->gl_isgraph && glist->gl_goprect &&
-        glist->gl_owner && (pd_class(&glist->gl_pd) != garray_class))
+        glist->gl_owner && (pd_class(&x->g_pd) != scalar_class) && (pd_class(&glist->gl_pd) != garray_class))
     {
         /* if we're graphing-on-parent and the object falls outside the
         graph rectangle, don't draw it. */